If you want to open up a gate, you can use a spell for it but to close a gate, you MUST manually do it (although the use of spell can be applied but you must use deathmeat's trigger, with of course, uses of region).
Open Gate - Spell
Close Gate - Typing chat message (just test the map WITHOUT opening it in WE)