Your function to call is "UsedKeyOnDoor"
However your function name down here is just "KeyOnDoor"
I would also double check the name of the door in your game. It should be the same as you have it here ("doorstair")
I have rewritten your code fixing your issue as well as another you had with your sounds. You have to have the .snt extension.
Please please please! I really want you to look over the code and take a look at your mistakes and rewrite the code yourself. You should use this as a sort of guide, but not a copy-pasta solution.
void OnEnter()
{
AddUseItemCallback("", "theKey", "theDoor", "usedKeyOnDoor", true);
}
void usedKeyOnDoor(string, string)
{
SetSwingDoorLocked("theDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "theDoor", 0, false);
RemoveItem("theKey");
}