I don't think you should have a composition_rel AND a membership_rel between groups, so to test your change you would have to change so that when you add a group as a member of another group it only creates the membership_rel.
One or the other should be fine. I think enabled groups as members was discussed on the forums before, I'll see if I can find it.
I am curious what you are trying to do that you can't do with composition_rel.