I resolved the issue! Turns out the dialogue system was sometimes only writing all the letters minus one. This can be fixed easily by changing line item 21 from
written_letters greater than or equal to letter_count
to
written_letters greater than letter_count
This image is set to display the text correctly! :)