Your lucky I got some exams tomorrow, this presents a perfect opportunity to procrastinate!
Try this ... you add the objectID, ZYX, time to open, move to XYZ in the gates table, I've already added your own two gates in it. So basically to open the first gate you do /open 1, and for the second /open 2, etc.
Same with /close.
I'd recommend adding a colcircle around the gate tho since it's a bit unrealistic to open a gate in SF while riding in LS , or just check the distance between GetDistanceBetweenPoints3D using the gate position as one point and the players position as the other.