You can draw on the canvas inside a routine by create a draw section. This begins with "draw onto XXXXX" where XXXXX is either the name of a sprite or "_top" or "_bottom".
Specify _bottom to draw below all the sprites.
Specify _top to draw above all the sprites.
When drawing lines you need to call either stroke or fill for the drawing to take place.
Please also note that expressions are NOT supported in draw parameters. They can work, but we are doing further testing before making that official.
Draw on sprites