The way I usually implement this is to have states that utilize external variables:
enum { STOPPED, MOVE, FWD, REV } state;
switch (state) {
case REV:
leftSpeed = rightSpeed = REV_SPEED;
state = MOVE;
break;
case FWD:
leftSpeed = rightSpeed = FWD_SPEED;
state = MOVE;
break;
case STOPPED:
leftSpeed = 0;
rightSpeed = 0;
case MOVE:
motors.setSpeed(leftSpeed, rightSpeed);
break;
}
Serial commands can just send the leftSpeed and rightSpeed values over as 8-bit signed integers, and as long as the state is MOVE, the commands will be followed.