I told you exactly how to do it in your thread at Massassi. If you don't understand something, please tell me and I'll clarify it.
You want a button to unlock or lock a door, a toggle. Okay, so you'll need your lock button to target a target_scriptrunner.
Give the scriptrunner the following keys and values:
PARM1: LOCKED (or UNLOCKED if your door starts unlocked)
PARM2: Targetname of a target_activate which targets your door
Parm3: Targetname of a target_deactivate which targets your door.
Here's the script I would use:
//Generated by BehavEd
rem ( "Toggles an entity locked/unlocked through activation" );
rem ( "Checks the condition of locked/unlocked by reading what PARM1 is," );
rem ( "then sets PARM1 to LOCKED or UNLOCKED, and uses either PARM2 or PARM3," );
rem ( "which contain the targetnames of the target_activate and target_deactivate entities" );
rem ( "which target the lockable entity." );
if ( $get( STRING, "SET_PARM1") = "LOCKED"$ )
use ( $get( STRING, "SET_PARM2")$ );
set ( /*@SET_TYPES*/ "SET_PARM1", "UNLOCKED" );
else ( )
use ( $get( STRING, "SET_PARM3")$ );
set ( /*@SET_TYPES*/ "SET_PARM1", "LOCKED" );