Commented Code

motorSpeed(4, -30); //All motors move forward for three seconds
pauseFor(3);
motorSpeed(4, 0); //All motors stop for two seconds
pauseFor(2);
motorSpeed(4, 30); //All motors move backward until following criteria are met
int n = getBackwardCounts()-getForwardCounts();

//The AEV will continue backward until it reaches its starting position
while (n > 0)
{
n = getBackwardCounts()-getForwardCounts();
}
motorSpeed(4, 0); //All motors stop
pauseFor(3);
motorSpeed(4, -35); //All motors move forward for four seconds
pauseFor(4);
motorSpeed(4, 25); //All motors move backward for one second
pauseFor(1);
motorSpeed(4, 0); //All motors stop