When deploying at a gate-breaking party, I go in stages. Everything has to be lined up to be deployed properly, though.

-Battering rams (always 3) lined up along one or two sides to best avoid any tower fire. Sometimes you can completly avoid it.

-Behind the battering rams I click and drag my troops to lay out a formation only four rows across (4wide). This allows them to fit through the hole without breaking formation. Velities and Light Aux come first (to break up any defenders), then Aux (to break the inevitable horse charge), then hastati/Early Legion followed by any Legionary Cohorts in the rear.

-The hole furthest from the actual gate is for Aux/Archers/Horses only (again, 4wide). If there are no defenders, the horses go through first to attack the defenders at the other holes from the sides.

-When moving the 4wide formations, once they are at the gate (not through it), click and drag your final formation in the enemy encampment. No one will get hung up if you time it right.