You are in the right spot. It tells you how to add it, so now you know what to look for. Here is a quick one I wrote. It might get you going on the right path. There is also code floating around the net for removing mtext formatting. If you find one, you can steal (borrow) the portion needed to do your code.
(defun StripString (String / cstr1 cstr2 nString cnt1 tstr1)
; Strips out formation for color, font, height and width.
(setq cnt1 1)
(while (and (setq cstr1 (substr String 1 1)) (> (strlen String) 0))
(if (= cstr1 "\\")
(progn
(setq cstr2 (substr String 2 1))
(if (member (strcase cstr2) '("C" "F" "H" "W"))
(progn
(while (/= (substr String cnt1 1) ";")
(setq cnt1 (1+ cnt1))
); while
(setq String (substr String (1+ cnt1) (strlen String)))
(setq cnt1 1)
); progn
(progn
(if nString
(setq nString (strcat nString (substr String 1 1)))
(setq nString (substr String 1 1))
); if
(setq String (substr String 2 (strlen String)))
); progn
); if
); progn
(progn
(if nString
(setq nString (strcat nString (substr String 1 1)))
(setq nString (substr String 1 1))
); if
(setq String (substr String 2 (strlen String)))
); progn
); if
); while
(setq tstr1 (vl-string->list nString))
(if (and (not (member 92 tstr1)) (member 123 tstr1))
(setq tstr1 (vl-remove-if '(lambda (x) (or (= x 123) (= x 125))) tstr1))
); if
(vl-list->string tstr1)
)