What I would do is add some Serial.print() statements to see what the robot is doing. After deleting all the commented out code, that is.
In the IDE, commented out code changes color, and is easy to skip. On the forum, working code and commented out code look the same.
Perhaps I should write a new code implementing some of these things, see if that works, and if it doesn't come back here again and ask about more specific fixes?
This is not a bad idea. You learned some stuff writing the first code. You've learned some stuff as a result of this thread. Any new code you develop is bound to be better/easier to debug/understand.
Perhaps when you get done, either the problem will have gone away, you will have had an "oh, shit, why was I doing that" moment, or the problem will still exist in code with Serial.print() statements that show what is actually happening.
If the first two possibilities don't pan out, do post the new code, and we'll try again.