Make something happen on a continous input just once and for a specific amount of time
you want something along the lines:

bool continuing;
#define trigger 't'
void loop(){
  if( Serial.avaiable()) { 
    char c;
    c=Serial.read();
    if (continuing) { 
       if (c==trigger) { //do nothing, ignore it
       } else { 
       continuing=False; }
   } else { 
     continuing=True;
     motors.start();
     the_time=milis();
   }
 };
 if (the_time+timespan&gt;milis()) {motors.stop();};
}