The problem with Mtext, and dxf codes is that if the string is too long, then you need to check if it has a dxf code of 3 (for continueing the string). I would reccomend that you use the ActiveX properties to get the text string.
Example using what Mark posted.
(defun c:blastReturns (/ rm-returns ent entlst str new_str TxtObj)
(defun rm-returns (str)
(while (wcmatch str "*\\P*")
(setq str (vl-string-subst " " "\\P" str))
)
str
)
(if (setq ent (car (entsel "\nSelect MTEXT: ")))
(progn
(setq entlst (entget ent)
; str (cdr (assoc 1 entlst))
str (vla-get-TextString (setq TxtObj (vlax-ename->vla-object Ent)))
new_str (rm-returns str)
)
; (setq entlst
; (subst (cons 1 new_str) (assoc 1 entlst) entlst)
; )
; (entmod entlst)
(vla-put-TextString TxtObj new_str)
)
)
(princ)
)