The drawing should probably happen in the spytask task which draws most of the rest of the CHDK gui, and be repeated on each re-draw as long as you want the pixel to be visible. So I would suggest that the script commands built up a list of things to draw, and some code in the gui actually takes care of drawing them.
Scripts run in the kbd (aka physw) task.