I've already scripted limits on it. Basically there is a basic list of "needs" from the NPC. If the NPC has access to it, then it won't do anything. If not, then it will build it (dig) within a set area. It's running a predefined script anyways, so it can't go too far. It also can only have one of each need so it won't build more then that. If another NPC goes to "war" against the other NPC and attacks the house room for example, and the room gets it's HP to zero, the first NPC will have a new set of needs such as go get repair materials and repair the house.
I haven't gotten that far in just yet. Still working on getting it to build rooms for it's needs but that's the basic idea. I'm running it on a test version of my world so if it gets screwed up somehow, I can just steal a copy from the live build.