I have searched high and low for the abit/qbit snippet and I have yet to find anyone that has it. Here is my vision:
I want a flag to be set in the pfile. When someone plans to enter the area, I want the flag to be checked first. I also want Mobiles and IMMs to be able to set these flags.
I think the flag would could/should look something like this
A<area> 0/1 - one will grant access, 0 will deny it
So, I understand this is going to be a huuuuge overhaul on the code, but I think I have enough coding expirence to take it on piece by piece. The only problem is, I dont know where to really start.
What you'd want to do is find every point in the code that a character can use to enter an area, or rather, change from one area to another. Such points would be: moving around, transportation spells, etc. You'd want to check things that characters can do (e.g. walk, teleport) but also things that can be done to characters (e.g. be summoned) and block both of these. This will probably be the trickiest part because you might miss one or two subtle places. I'd make sure to only prevent area changes, so that if the player does somehow wind up in the area, they can still walk around and leave it and won't be completely stuck.
(This is one place where you feel a lacking aspect of SMAUG's design. If there were one common gateway function for permission checking, a function playing the role of can_enter of sorts, then every movement function could check the same function, and it'd be much easier to do the kind of thing you're talking about. As it is, it's tricky business because you might forget something somewhere, or you might add new ways of moving around and forget to have them check for this flag!)
As for adding bits to the character file, that's really not too hard. Look around in save.c for how things are loaded using KEY. What you would do is default the entire array of flags to zero, and then read in for a character which areas to set to one. You could store the array as a linked list, where each element has the name of the area in addition to the flag, that way you have a way of mapping area name to flag.
And finally, letting mudprogs change/read the variables is also pretty straightforward. Changing is just a matter of having commands that NPCs can use that interface to this flag system. And for reading, you would add a new ifcheck, which is also relatively straightforward, since you'll have the entire helper function setup done already.