So, if I'm understanding your post correctly, you want to read a text file into the text object then automatically determine how many lines of text there are, and scan through all the lines of text as quickly as possible. Is that correct? Then, does this work? I don't have any text files with 12,000 lines in them to test, but it works just fine with shorter text files.
What is wrong with the "dump" message to text? That is what I would use anyway. What you call freezing for the various solutions posted already, is what you ask for if you dump so many lines... (I bet there is some logic after your text object, which has to be calculated 12000 times as well, line after line...)