Ok, constructions....
Code:
~~ Constant groups; nothing varies by Area ~~
[Idle group] -- simple aftercast stuff
[idle sets]
[resting sets]
[PDT/MDT armor sets]
[movement]
[convert (for max hp/mp)]
[per-job stuff; eg: Sublimation for sch, etc]
[JA group]
[enhance JAs]
[puppet maneuvers]
[waltzes/sambas]
[Basic magic]
[Fast cast]
[Cures]
[Enhancing magic]
[self-buff Ninjutsu]
~~ Variable groups; may have additional Area specializations ~~
[melee group]
[tp sets]
[per-job stuff; eg: Impetus for mnk, etc]
[JA offense group]
[weaponskills]
[jumps]
[steps]
[magic offense]
[enfeebles]
[nukes]
[elemental/enfeebling ninjutsu]
That would be 3 constant groups, and an additional 3 groups per Area. So, a default of 6 groups, 9 if you add Abyssea, 12 if you add Legion, 15 if you add Voidwatch. Of course most of the time you don't actually want to add a new area, you really just want to modify which TP set (Berserk up/down, max accuracy, etc), or which magic accuracy set is being used. I expect most people will only need the 6 default groups.
The only Area variance I can think of for the Idle group would be something like Balrahn's Ring, for refresh in Assault/Salvage. However that can as easily be done with a variable in the ring equip slot, without requiring an entire additional group.
Not quite sure how you'd want to split up blue magic.
The next trick is how to make it work. A simple massive pipe like my $CurrentSet variable doesn't work, because sets are spread out across groups. However I think it can reasonably be split into segments.
First the base layer; engaged or idle will determine which group to use. Then the various armor-type sets pulled from the Idle group.
<equip when="aftercast" group="$BaseGroup" set="$BaseLayer|$JobUnique" />
<equip when="aftercast" group="IdleGroup" set="$JobUnique|$PhysicalDefense|$MagicalDefense|$ Movement" />
And then precast/midcast can be specified by the type of action being used.