zoomkat:
I suggest you put the web server code in the main loop, and put the bot control code in conditional functions. Any significant delays need to check current time vs past time to avoid delays in program execution.
I don't think so. If the web browser misbehaves etc. then the connection will stay alive over a period of time too long for the robot to roam without sensing its environment. As I suggested already, OP should use state machine to take in each client byte at a time and NOT to run the server code like nothing else matters!