my switch code, which I posted back in the toggle script discussion:
if frame==1 then setVar("1",0);elsif key("up")==1 then getSetVar("1",1);elsif key("down")==getVar("1") then getSetVar("1",0);end;
...just posted it here because it might be useful, isn't really what you're looking for though.