I changed "grename" so that it also handles changes from hidden to unhidden groups, and vice-versa. Though there is an X error, which I think causes focus to be lost, when i change the current group from visible to hidden (e.g. "grename .test") and then try to list the groups with "groups" or "vgroups". Perhaps someone can give me an idea why this happens so that i can fix it.
The other way around and the rest of the function work fine.