Look at the example i posted (It's a function so you have to call it). here it is again;
Notice how it loops until the input is complete.
I would just take this function and incorporate it into your code.
Function Input(textin$,length)
SetCursorBlinkTime(0.5)
SetTextInputMaxChars(length)
StartTextInput(textin$)
do
sync()
state=GetTextInputState()
c=GetLastChar()
if GetTextInputCompleted()
if GetTextInputCancelled()
text$=textin$
exit
else
text$=GetTextInput()
exit
endif
endif
loop
StopTextInput()
sync()
endfunction text$