Switch State Issues?

What do you mean by program state? and where would that be added.

A variable in your program that holds the current state. It might be a simple byte variable where 0 is the startup value, 1 is motor running, 2 is motor stopped and LED on, etc.

Then you simply react on that state in your main loop and remove all while loops inside it. You simply check the state variable and depending on it's value you can set outputs, react differently if the reed switch is triggered, etc.