Will this do what you want?
(cdr (assoc 1 (entget (car (entsel "\nSelect Text/Mtext to see its contents text string, or Dimension to see override text if any: ")))))
It's potentially complicated by the fact that very long Mtext breaks up the content into multiple entries, not under DXF code 1, if that might sometimes be your situation.
It will show you codes for font overrides, superscript, color, etc. within Mtext and override Dimension text, and underline/overscore/degrees/diameter codes in plain Text, and the <> representing the measurement if part of override Dimension text.
If by "their codes" you mean the ASCII code numbers of the characters involved:
(vl-string->list (cdr (assoc 1 (entget (car (entsel "\nSelect Text/Mtext...: "))))))
Kent Cooper, AIA