You will need say a cond to seperate Text & Mtext, for me make a seperate defun for each variation and use a cond, so you have Text, mtext atts x2.
For mtext you would use VL much easier and look for the paragraph breaks \\p in the string and make say a list of each line, then just step through the list changing the text making a new list and last put the string back into the Mtext. Google Mtetxt to list shoudl be something out there.
Re attributes need to clarify what exactly do you want are you saying a attribute may be MTEXT rather than just Text. Again 2 defun if INSERT & ATT is TEXT, INSERT & ATT is MTEXT. Also which attribute ?
Maybe need a 3 choices before SSGET.