Actuator Control via a Serial Monitor - Issue

Sorry should of explained it clearer.

Ignoring the serial stuff, if I wanted to move the actuator forward for 5 seconds it would look like this.

analogWrite(PWMPinA1, Speed);                  //apply desired speed
analogWrite(PWMPinB1, 0);                          //apply no speed 
delay(5000);  

Pretty simple. If I put the delay to 0, it does nothing, understandable. But when I put in the serial stuff, and type in the case A, it will extend even though it should'nt be since the delay is set to 0.