She was absorbed in writing poetry.

Literal

She [topic-は] poems [object-を] write [in-のに] was-becoming-absorbed.

The frame [verb]+のに+夢中になる combines a nominalized verbal clause with the idiom 夢中になる ('become absorbed in / engrossed in'). 夢中 literally means 'inside a dream,' a vivid metaphor for total immersion — used for hobbies, games, romantic infatuation, or any activity that takes over one's attention. Here のに is the nominalizer の + the target-marking に, marking what she's absorbed in (don't confuse with contrastive ~のに 'even though'). The past progressive ~ていた describes her ongoing state at the time being narrated.