If the script is running 'on' the object, then you do not need to specify the reference.
So, if the script is attached to the locked container, you just need to code the lock as you have it above. The reference is taken from the object the script is running on.
Well that's good to know, maybe I'll tackle that then. I don't know why Bethesda handled lockpicking/hacking like they did, it's really quite silly. You'd have to be really foolish to take those perks with the way things work. At least doing it this way will make them worth something. I'm planning on making a no VATS perks package and maybe I'll throw those in there as well.
Speaking of which, I've been thinking about the Mysterious Stranger. Is it possible to have him spawn out of VATS close to the player during combat, then set up a timer which would remove him when the time ran out? I've managed to come up with alternative ideas for the VATS only perks, but that's one that still eludes me. Grim Reaper Sprint is another. I'm thinking maybe I can do something with IsKiller but I'm not sure. Right now I just have 100% damage if I hit something in the head, but I'd like something a bit closer to the original now that I've managed to make Action Points useful out of VATS.