since asEntity is the entity we used the item on and the asItem, obviously, is the item.
This way you can make a global method to unlock doors, no need to make functions for every door you have to unlock.

RE: Can't get door to lock using SetSwingDoorLocked("mansion_1", false, true)

You should Add: AddDebugMessage("Type anything you want here", false);

What this does, it says something at the very bottom very left. It says the thing you typed in the AddDebugMessage. Its useful to see if its even doing anything. You need to have the Debug Messages activated. Activate it here: C:\Documents and Settings\"YOUR COMPUTER USER NAME\My Documents\Amnesia\Main\"YOUR AMNESIA PROFILE NAME"\user_settings.cfg
Open it with your favorite text editing program. I recommend Notepad++. But you can still use the Notepad thing. If you don't want to get Notepad++ or don't have it, right click the file, Click Open With, select Notepad, Uncheck 'Always use the selected program to open this kind of file' If you don't uncheck it. It will mess up .cfg's FOREVER! So uncheck it. Press OK. It will open the file. Find:
ShowDebugMessages="false" Make: "false" to "true". It will show the debug messages. There are other useful and useless stuff to set true and false in the file if you want. You can always go back in the file and change it.

RE: Can't get door to lock using SetSwingDoorLocked("mansion_1", false, true)

First you need to go into the editor and click on the door and set "locked",
then you need to replace you scripting part where you have "UsedKeyOnDoor" and write the name of you key.. So it sould look like this..