You've asked a good question about a grammatical structure that we don't often see.
In your sentence "am writing" is the present continuous verb and it is followed by a preposition that ends in -ing.
The verb can be in written in any of the continuous aspects/tenses and followed by a preposition with an -ing ending.
Here is a short list of prepositions with an -ing ending:
assuming
barring
concerning
considering
during
following
including
involving
pending
regarding
succeeding
These prepositions are difficult to recognize as prepositions, but they are, and they are usually followed by a noun.
Here are a few examples of a continuous verb followed by one of the -ing prepositions:
- He was sleeping during the movie.
- They were hesitating assuming the worst.
- You will be going barring any interruptions.
- The company has been downsizing including laying off workers.
- I had been reading during the flight.
- We will be waiting pending the president's decision.
As you can see, these structures, i.e., continuous verbs followed by an -ing preposition are not commonly used structures.