Modelling roles in custom target system

Hello,

I have a custom target system that I have set up with Scripted Synchronization. I can set up account insert/modify/delete through the scripts without issue. Each account in the system belongs to one and only one role, and that's what I'm having trouble with. I can create the roles as groups in UNSGroupB and create the required scripts so that the assignments are scripted, but I'm not clear on how to make sure that only one group is ever assigned to an account. I suppose I could make sure that I clear all memberships in the CCC_UnsAccountBInUnsGroupB_<systemname>_Add script before I assign the new one, and I suppose I'd need a fallback role in the remove group script.

I was wondering if there's a better way of doing this, or is this the correct way to implement roles.