I forgot to test it with extended basic, not sure how robust it is with different configurations. After enthusing endlessly to my coworkers (most of whom weren't born when I got my TI) about an "escape from the sandbox" it turned out that one of them had a website with tons of TI-99/4A cartridge ROMs plus two TI computers at home. He brought one in (foolishly got rid of mine in the 90s) and I laboriously typed in the whole program (this is before I found the oldcs1 utility).
Anyway, here's some source code used to re-make the lines program. You can do a lot ~110 bytes at a time
linesBasic.zip.zip