Can I just make sure I've got the general idea of your program correct, based on my inexpert reading of the code: The program runs continuously in the background. When it detects an incoming call, it quickly changes the system-defined ringtone using a symbolic link, based on a lookup of which phone number should be in which group. The actual playing of the tone is done by the phone app itself. Is that right?
Does your app impact battery life, if it is running in the background all the time?
Thinking about a potential GUI, obviously there would need to be a way to define groups (giving each a custom name would be nice), plus a way to pick a ringtone per group. Then there would need to be a way to associate a contact with each group. I wonder if there's a way to hook into the contacts framework to do this. Maybe the group could be stored as a Note field in the contact, or something like that.