Hi Ross. I think I understand your question. If you gosub, the gosub will cancel if it doesn't reach the end line that says return. For example:

gosub lightled

lightled:
if porta.1 = 0 then turnonmotor 'jump out if motor switch is closed
high portb.1 'light up led on port
return

turnonmotor:
high portb.2 'turn on motor driver transistor
goto motorcontrol 'go to a completely different area in program

your gosub cancelled as soon as it went to turnonmotor and avoided the return line. Hope this helps.