Ken — you’ve been using SUBs and FUNCTIONs since the first time you started programming back in 95. ;)
All a SUB is, is a basic routine which you decide you need to repeat multiple times in your code.
In your original, you use several in-built SUBs — CLS, CIRCLE, LINE, _LIMIT, _DELAY.
CLS is basically just a routine which clears the screen. Circle just draws a circle where you specify. You could write your own routines and do the exact same things, if you wanted to — and that’s all a SUB is.
For example:
And, to do the same with your own SUB:
ClearScreen
LOCATE 1,1 ‘start at the very top corner
SUBs basically just say, “Repeat this process when needed”, while allowing the programmer the flexibility to customize their own routines and easily move them into other programs as needed.