I had this same problem and got it working eventually,
I copied the code from 17_controlroom.hps and changed the names of the valves etc so it would work. I also had to add some more code because for some reason the gate wouldn't slowly slide back down when i wasn't using it.
you also have to go onto leveleditor, click on the valve > entitytab and check fullgamesave, add a playerinteractcallback called InteractWheel, tick playerinteractautoremove, set stuckstate minimum, and interactiondisablestuck. the door should now work properly, and slide down when not interacted with.