As described for what you want Allens' script should do what you wanted.

It checks all 3 groups every time and runs the shortcut UDF for each group if the user is a member.
 
If something is not working as expected then make sure the user is in the specified groups and / or remove the KiXtart cache (/f switch) and test again.