What Swahle said is pretty much correct, but just to add to that.
Quote: "1.) You could put trigger zones on either side of the exit. The one outside should change the guards script to an aggressive one, and the one inside should revert it back to passive or whatnot. You would just have to figure out how to make it reaccuring, unless you only needed to do it once (which i suppose you would). "
I don't really know if you can use the 'runfpi=X' from a triggerzone for a character. I mean, the runfpi=X would run for the triggerzone itself, not for another character. But you can surely try that out.
I would suggest, using 'plrdistancewithin' in the guard script instead.
Quote: "2.) For the lock, theoretically you could put in an inanimate cell door with a lock on the texture, then when shot, or destroyed or whatnot, it would call for the animated entity to replace it, but you couldnt make it so that only when the lock portion of the door is shot it will occur."
Use a fake door. And use a lock entity (model it). Then you can make sure you actually have to hit the lock for things to work.
-- game dev is fun...but taking up too much time --