Ok, well I attempted some more. If you find any bugs I overlooked post back and tell us what it is.

Code:
Raw 366:*: {
  if (!$hget($2)) hmake $2
  if (!$hget($+($2,.total))) hadd -m $+($2,.total) $nick($2,0)
  var %users. [ $+ [ $2 ] ] $nick($2,0)
  while (%users. [ $+ [ $2 ] ]) {
    hadd $2 $nick($2,%users. [ $+ [ $2 ] ])
    dec %users. [ $+ [ $2 ] ]
  }
}

On *:Part:#: {
  if ($nick != $me) {
    if ($hfind($chan,$nick)) hdel $chan $nick 
  }
  else { hfree $chan | hfree $+($chan,.total) }
}

On *:Join:#: {
  if ($nick != $me) {
    if (!$hget($chan,$nick)) hadd $chan $nick
  }
}

On *:Kick:#: {
  if ($knick != $me) {
    if (!$hget($chan,$knick)) hdel $chan $knick
  }
}

On *:Quit: {
  if ($nick != $me) {
    var %x = $comchan($nick,0)
    while (%x) {
      if ($hfind($comchan($nick,%x),$nick)) hdel $comchan($nick,%x) $nick
      dec %x
    }  
  }
}

alias users {
  echo -a Number of users when joined: $hget($+($active,.total),1).item
  echo -a Number of users now: $nick($active,0)
  if ($nick($active,0) == $hget($+($chan,.total),1).item) echo -a Number of uses when joined is equal to number of users now.
  else {
    echo -a $iif($nick($active,0) > $hget($+($chan,.total),1).item,Joins: $calc($nick($active,0) - $hget($+($active,.total),1).item),Parts: $calc($hget($+($active,.total),1).item - $nick($active,0))))
  }
}


/users returns the following if the number of nicks is greater than the numebr of nicks when you first joined.

Number of users when joined: 5
Number of users now: 6
Joins: 1

When it's all even Stevens you get a message like:

Number of users when joined: 5
Number of users now: 5
Number of uses when joined is equal to number of users now.

And for part it should change Joins: to Parts:

All the best. smile

-Andy