Theory #1 " Gate is a destructible " :
With a periodic event , or any event of your choice, check if the destructible 'Gate' is alive, if yes, pick every unit far from the gate X radius ( for example 500 ) then order it to attack. If the gate is destroyed, either do : 1- Pick every unit from 500 radius from the gate and order it to attack-move behind the gate, OR , create a region and order them to move to it, there are many solutions for this.
Theory #2 ' Gate is a unit ':
Just Order your units to attack-move behind the gate with one of the ways stated above ( using region point or polar offset ) , they will automatically attack the gate 'til they reach units behind it.
Example for polar offset :
-
Set Beyond_The_Gate_Point = ( (Position of destructible 'Gate') offset by 600 towards (Gate Facing - 180))
-
Unit Group - Pick every unit in Enemies_Group and do multiple actions
-

Loop - Actions
-


Unit - Issue order unit to attack-move to Beyond_The_Gate_Point