Programme running without initialization command

Can you not post the code inline? I'm on a phone here so I can't open it.

From the words you use, I can suggest an alternative. Do not try to stop the sketch. It should be always running, watching the sensors and listening for commands. If the command is "stop" then stop the motors, don't stop the sketch.

Before the first command arrives, is it so hard to store a dummy 'previous' command of "stop"?