Very sensible points raised.
Men can only fight for very brief periods; out of every hour of combat you'd be lucky to get 15 mins of "real" combat across the hour. And those 15 mins would be split into a series of shorter combats punctuated by falling back to the main line to regroup. After each spate of combat the lulls get longer. During these lulls line relief both internally within say a phalanx or cohort is most likely to have taken place. More significant lulls permit entire formations to be reinforced and pulled back, i.e. the Roman system.
It was probably only when seriously pressed or falling back that this becomes problematic to say the least, leading to crowding and the potential for a final push by the enemy to break up the formation, i.e. Othismos.
DCRBrown