Simply iterate thru all the Layout objects againt its Block object, checking each object within the block (a layout and model space is treated like a block) to see if it is a text-based object.
But in all honesty, a filtered selection set is better, e.g.:
(setq CurSet (ssget "X" '((0 . "TEXT") (-4 . "<=") (40 . 4.7))))
Note that the "X" option searches the entire drawing without user interaction.