I love my TIs, but this is convoluted. So If the first 16K is shared with the video ram, the longer the BASIC program it is, the less video RAM is available, which in theory, would make colors and sprites to start disappearing.
The above example isn't a true representation of the maximum allowed lines in BASIC. You are using an array, which uses much less memory than an actual line of BASIC could. You are counting how many 'A's can be created dynamically until memory is full.
Anyhow, this has left me with a splitting headache, and finds me wondering how such a system exists without it being made more of a deal about back in the day.