The text box has a new event block that triggers every time the text box changes.
That gives you a place where you can check the text length and shorten it using the text segment block
if length(textbox.text) > 5 then
textbox.text = segment(textbox.text,1,5)