Comprehend Languages allows you to read and understand spoken language, but not speak or write.
Tongues allows you to speak and comprehend spoken language, but not read or write.
Is there anything (spell, class ability, magic item, etc.) that would allow a creature to write in an unfamiliar language (possibly in conjunction with one of the above spells)?
The Belt of Dwarvenkind (DMG p. 155) allows the attuned wearer to speak, read and write Dwarvish.
It you’re willing to delegate, there’s a mundane solution: a scribe is a skilled hireling who will charge 2 gp per day for their services (PH p. 159), and you can check their work is reliable with comprehend languages.