This is all about good gameplay, a much neglected topic. Cinderella to the Ugly Sisters of Cutscenes, Scripting and Addons.
I don't know of any way that you can put a perimeter on a guard group's area (BMPs will cross the sea to try and get to you). However, if you create a trigger over the area you want most protected (i.e. around the base) and make it guarded by East/West then that might help.
However, the real secret to what you are trying to do is switch triggers. If you are not familiar with them I would read up some trigger tutes in the Ed Depot - Getting Started. Anyway, here is an example. Let's say Resistance are attacking a West held town.
Res patrol group, set on patrol with a bunch of Move wps and a Cycle wp. After the Cycle wp there is a guard wp. Now create a trigger.
area: town centre
activation box: Res present / Res detected by West
Synchro the trigger (F5, then drag and drop the blue line) with the Cycle wp.
Now the group will follow its patrol path until the trigger is fired, when it will become subject to the guard wp.
If you want a delay, then put numbers in seconds in the Timeout min-max-mid boxes in the trigger. Timeout makes a delay between the trigger being activated (R present or whatever) and it being completed. So if you had 10 - 20 - 15 the patrol group would continue to patrol for something like 15 seconds before the guard waypoint kicked in.
Timeout in a wp works in a similar way. If you put a delay in a Move wp the group will wait at that spot until the timer has finished before moving on.
It can be interesting to use Hold or Seek and Destroy wps instead of Guard. However, you will need additional Cycle wps or switch triggers to prevent the groups from completing their last wp and finishing up just standing there. Units on a Hold wp will pursue the enemy for a certain distance but will usually return after a while. Groups with a Guard wp will pursue the enemy for ever, and tend to hang around the area where they last saw the enemy rather than going home.
You could give one of your groups just a S+D wp in the town centre, with a Cycle wp next to it so that they keep moving. They will run around all over the place looking for the enemy.
You could place several triggers around the town in concentric rings, to give a layered response. One trigger can be synched with the wps of several groups. Alternatively have several triggers with the same radius but different timeouts. Or both.
Start each group off close together in the middle of the town. I don't know how the "fleeing" response works, but I suspect that one of the factors which influence the direction that a fleeing AI takes is where he started. Obviously he will move away from the enemy, but I think its more sophisticated than that.
Small patrols (2-3 loons) look good and make for better detection. However, in battles larger groups are more desirable (otherwise you just get random West loons running around aimlessly, because they are the only loon left in their group). Consequently its a good idea to get small groups to join together when the enemy is spotted. You can use Join and Join and Lead wps for this (fired by switch triggers) and several groups can join together simultaneously as long as one and only one has Join and lead.
To make a good mission you will need to use several of these techniques, and preferably a few others of your own or other people's.
If anybody can tell us more about what "Guarded by" really means, and what effect it has in practice, I'd be grateful. All I've noticed is that if there is one guard group and two lots of enemy are detected simultaneously - one in a guarded by area and one not - the guards will go after the enemy in the guarded by area.
Edit: you could have a little looping script running in the background throughout this crucial phase of the mission.... looping say only once every 10 seconds so as not to eat up too much CPU. Use it to check if any guard group is too far from the town. If it is, it gets a doMove to bring it back. However, if you get your waypoints right you won't need this. Triggers and waypoints are much more powerful that many scripting afficionadoes appreciate.