- You really don't want to be addressing one motor from two conflicting places at the same time. That's why they fight each other. Are you also setting the same motors in both False cases? That would be telling it to go and stop at the same time.
- You need a Wait (say 10ms) in your loops otherwise you threaten to overload and lock up your CPU.
Instead, make all your decisions about what you want the motor to do, then set the motor only once.
Here's an example for a Relay. Just replace the Relay with your motor in the sequence you want.
Since you are keying off two different limit switches you can also select and pass in the corresponding limit switch name or reference.