The original script created a unique door with a unique key to unlock it. Double-clicking on the door when the key was in the character's backpack unlocked the door.
I have modified this to unlock the door when the key is double-clicked and the door is targeted. After a set amount of time (default 30 minutes) the door is relocked.
I have tested this with no issues. If anyone experiences any issues, or finds a way to make the script better or more efficient, please let me know.