Code:
on $*:text:/^!add\b/iS:#:{
  var %g $strip($2)
  $iif(!$3 && (%g == alpha || %g == beta),goto %g)

  msg # Group nonexistent. Use: !add alpha or !add beta
  halt

  :alpha
  %alpha = $addtok(%alpha,$nick,32)
  %beta = $remtok(%beta,$nick,1,32)
  goto end

  :beta
  %beta = $addtok(%beta,$nick,32)
  %alpha = $remtok(%alpha,$nick,1,32)

  :end
  notice $nick You are in the %g group
}