I don't think the scripting API offers anything to do that directly, however you could probably create an event sheet function that deactivate/activate a group name received in a parameter, and then call that function using scripting with the runtime function callFunction(name, ...params).