I believe there is a Utility.Wait command, so you could use that to wait x seconds before locking again
Question - Do NPC's actually steal from your containers?
I mean, if you really feel that they might try something.
Set the safe to be
On Open
if not PC
Actor.Die or something like that
I don't know about containers, (chests, desks, etc) but I've seen them steal a weapon off of a weapon rack.
Who knows for sure. Maybe they do. I think that was one of the bugs the developers had to deal with from the start. I remember reading something about an NPC that stole all the weapons in the towns and hoarded them in his house.
Either way, I'll give both scripts a test to see what happens. I guess if I find a bunch of dead NPC's in my house, I'll know.