please, if you want to share GUI code, use "[trigger]" codes, like cohadar did.
2nd: the code you posted will leak some groups, and since you execute that trigger every second this code will cause the map to lag badly in advanced game time.
You can fix those leaks by adding a custom script, which is
Trigger:
Custom Script: set bj_wantDestroyGroup = true
as you have to add this before every "Group - Pick Units ... " this will have to look like
Please note that custom script is basically pure JASS and as such VERY case sensitive.
Hope I could help.
Deaod