I remember that in vbscript it did cost a lot more effort to fix this.
In powershell you can use the Quest active roles powershell snap-in to do this with one line of code.

The Quest snap-in can be downloaded here

Example:  
  1. Get-QadGroupMember "Group1" | Add-QADGroupMember "Group2"