Manual and automatic mode

First, read about functions(), that will shrink your code by about 80%
Which in turn will allow you to see how the various calls interact with each other.

A couple of well thought-out functions with one or two parameters will make your code much more readable. e.g.
byte runMotor(leftSpeed, rightSpeed, duration);
You may need to think about it.

Adding a for() or while() will become trivial once you understand your own code,