As it was with your "door close" thread, this works more or less the same way.
;Header
desc = Use Switch (Press F to activate switch)
;Triggers
:state=0:state=10
;change here the fpgcrawtest="What you want to read ingame"
:state=10,plrdistwithin=60:fpgcrawtext=Press F ,fpgcrawtextsize=17,fpgcrawtextfont=Times New
Roman,fpgcrawtextr=255,fpgcrawtextg=255,fpgcrawtextb=255,fpgcrawtextx=50,fpgcrawtexty=70
:state=10,plrdistwithin=50,keypressed=33 1:state=1,plrsound=$0,activateifused=1,alttexture=1
:state=1,keypressed=33 0:state=2
:state=2,plrdistwithin=50,keypressed=33 1:state=3,plrsound=$1,activateifused=0,alttexture=0
:state=3,keypressed=33 0:state=5
:state=5:none
;End of Script
Note with this script I can press "F" on the switch to activate (open) a door and then press "F" to close the door and the script will terminate. This can be altered to your needs, but it gives you the foundation if you want to expand.
Again, works in both test and build.
There's no problem that can't be solved without applying a little scripting.