Debug messages are really helpful to try and determine where the problem is in your script. You turn on debug messages by pressing F1 while in-game if you are in a dev environment (which you really should be -
http://wiki.frictionalgames.com/hpl2/amn...evenvguide)
In this example, I simply wrote the command "AddDebugMessage("Door should unlock", false);" which will display the messages "Door should unlock" in the bottom edge of your screen if you have debug messages turned on. If it doesn't show up, it means that something is messed up with either the lever name or the "void Lever_Slaver(string &in asEntity, int alState)" part. If it do show up however, something is wrong with the "
SetSwingDoorLocked("Slaver_Lever_Door", false, true);" part, most probably the same, since the function is ran without problems.