Event
Unit enters region
Condition
Is unit ally of player x
Action
Open/Close Gate
If gate can be attacked/destroyed, you should strore life of gate into a real variable before you close/open it. And after you closed/opened it set life of gate to this real variable.. otherwise it will get full HP always.