Quote: "However, I think my code indentation is consistent and pretty well readable, thank you very much. It's not like I do this for a living"
Sorry, I meant something like this
FUNCTION UpDateDisplay$(InString$)
`If NewString$ contains something
IF InString$ <> ""
NewString$ = InString$: Length = len(NewString$)
`If pixel width of NewString$ exceeds box width
IF Text Width(NewString$) > Box_W-10
`Repeat this part until the line is short enough to pass..
Repeat
`Starting from 10 pixels inside the border, find the first space
SplitLine = INSTR(NewString$,chr$(32),Box_W-10)
`Copy the string up to the first space to make it short enough to fit
ThisLine$ = LEFT$(NewString$, SplitLine)
`Scroll the screen buffer up one line
For N = 0 to 20
Screen_Buffer$(N) = Screen_Buffer$(N+1)
NEXT N
`Print the line that is now short enough
Screen_Buffer$(20) = ThisLine$
`Assign the other half of the string to NewString$
NewString$ = RIGHT$(NewString$, Length-SplitLine)
`Reset ThisLine$
ThisLine$=""
Until Text Width(NewString$) < Box_W-10
ELSE
`If input doesn't need to be split
`Scroll the screen buffer up one line
For N = 0 to 20
Screen_Buffer$(N) = Screen_Buffer$(N+1)
NEXT N
`Print the new line to the screen buffer
Screen_Buffer$(20) = NewString$
EndIf
EndIf
ENDFUNCTION
But it's just personal preference. I'm well aware of that ^^. I'm pretty picky on my code layout compared to other programmers.
Looking at my personal preference indented code

, I still think that this line
SplitLine = INSTR(NewString$,chr$(32),Box_W-10)
is the part making trouble. The rest seems perfectly logical to me. I would suggest something along the lines of (improvised):
SplitLine = 0 : newSplitLine = 0
while newSplitLine = SplitLine
newSplitLine = INSTR(NewString$, " ", SplitLine + 1)
if text width(left$(NewString$, newSplitLine)) < Box_W - 10 then SplitLine = newSplitLine
endwhile
`Now SplitLine contains the last space before it goes over the box edge
Cheers!
Sven B