There is a code for RPG dialog (with word-wrapping and everything) in the Acknex User Magazine (AUM). There is a link at the bottom of this page, and there was some sort of a search for specific AUM, but I forgot how

If you cant find it, search each AUM.
PS.: If it is C-Script old, there is a section in each AUM about converting C-Script to Lite-C code...