Just use the main loop. Don't do a single movement, but put it into pices and put it into the mainloop. Something like this:
function my_brushmove()
(your brush moves)
endfuction
SetInterval(1, my_brushmove, n) ;or of course some other function that embeds your brush_moves and the menu things // n being any interval time
;;; "main loop"
Repeat
WaitEvent
Forever ; or until some event