Look at entsel and entget. Something like this, untested, no CAD today to check for typos
(setq MyEnt (entget (car (entsel "Select text:"))) ; Select an object
;; can do some checking here that the selected object is text
(setq MyText (cdr (assoc 1 (MyEnt)))) ; get the text string from the object
(princ MyText)
I assume you want to do more than just display the text in the command line, but these 3 lines above will do that, add to a LISP routine or make your own based around this maybe
Note that very long text strings (for example in mtext)(over 256 characters?) the text is stored in another variable in the entity description, something to be aware of