Unable to move two different motors at different times

timer a 16bit int holds what number as its highest?

change that to

unsigned long timer;

and you'll be able to handle numbers > 32K.