Hello,
I have done this very thing. First, we need to know what method you are using for resource selection in the skill group.
In our scenario, we have 5 resource skills assigned to 1 resource group. One agent is our expert in each group. The other other agents also possess the skill, but at a lesser weight. The CSQ is configured to select based on most skilled.
If you needed a 2-group scenario, the script could be used to dequeue a caller, assign a different CSQ (using the Set command and a variable for CSQ). You would then requeue the call in the new csq.
Hope this helps.
-Ronnie