If you want it to be like when a unit comes close to the gate just do it like this. Make a region on the place you want the gate to open when the unit coems to that point then make a trigger like this.
Events Unit - A unit enters Region 178 <gen>
Conditions None (depends on if you want to make it like the unit needs a key to open it. If you do want that reply and I will tell you how to make that also.)