It's remaining the same because you're not modifying it..

Code:
  var %i = 1
  while ($gettok(%unbannick,%i,44) != $null) {
    set %globalunbannick $remtok(%globalunbannick,$v1,1,44)
    inc %i
  }
  /echo $chan %unbannick
  /echo $chan %globalunbannick