For the unban script, you could try:

Code:
if ($banmask iswm $ial($me)) { do stuff }


As for the login script, this is a little something i did a little while ago. It can be improved alot, but I have to go to work soon so I can't edit it further, sorry.

Code:
menu channel,status {
  $iif($dialog(ulst),$style(3)) User List: { 
    ulst open
  }
}

On *:Disconnect: {
  ulst save
  if ($hget(loggedin_nicks)) hfree $v1
}
On *:Exit: {
  ulst save
  if ($isfile(loggedin_nicks.hsh)) remove loggedin_nicks.hsh
}
on *:start:{
  if (!$hget(ulst))  { .hmake ulst 10 }
  if ($exists(ulst.hsh)) { .hload -i ulst ulst.hsh }
}

dialog ulst {
  title "User List"
  size -1 -1 80 117
  option dbu notheme
  list 1, 2 2 77 87, size
  box "", 2, 1 -2 79 92
  button "&Add", 3, 9 92 31 11, flat
  button "&Rem", 4, 40 92 31 11, flat
  button "&Close", 5, 9 104 62 11, flat ok
}

On *:Dialog:ulst:*:*: {
  if ($devent == init) {
    var %x = 1
    while (%x <= $hget(ulst,0).item) {
      did -a $dname 1 $hget(ulst,%x).item
      inc %x
    }
  }
  if ($devent == sclick) {
    if ($did == 3) {
      var %ulst.add = $$input($cr,e,User List - Please add a nickname), %ulst.pw $$input($cr,e,User List - Please add a password)
      ulst %ulst.add %ulst.pw
      did -a $dname 1 %ulst.add
      dialog -v ulst ulst
    }
    if ($did == 4) {
      if (!$did($dname,1).sel) return
      ulst -r $did($dname,1).seltext
      did -d $dname 1 $didwm($dname,1,$did($dname,1).seltext,1)
    }
  }
}

alias ulst {
  if (!$hget(ulst)) hmake ulst 10
  if ($1 == -r) {
    if (!$2) echo 2 -a * /ulst: insufficient parameters
    elseif (!$hget(ulst,$2)) echo 3 -a * /ulst: $2 not in user list
    else { hdel ulst $2 | echo 3 -a * Removed $+($chr(2),$2,$chr(2)) from user list }
  }
  elseif ($1 == -l) {
    if ($hget(ulst,0).item < 1) echo 2 -a * user list empty
    else {
      echo 2 -a * ulst list:
      var %x = 1
      while (%x <= $hget(ulst,0).item) {
        echo 3 -a $hget(ulst,%x).item
        inc %x
      }
    }
  }
  elseif ($1 == save) hsave -i ulst ulst.hsh
  elseif ($1 == open) dialog $iif($dialog(ulst),-v,-dm) ulst ulst
  else {
    if (!$2) echo 2 -a * /ulst: insufficient parameters
    elseif (!$hget(ulst,$1)) && ($2 isalnum) { hadd ulst $1 $2 | echo 3 -a * Added $+($chr(2),$1,$chr(2)) to user list with password $+($chr(2),$2) }
    else { echo 3 -a * /ulst: $1 is already in user list }
  }
  hsave -i ulst ulst.hsh
}

on 1:Text:login*:?: {
  if (!$hfind(ulst, $2)) { 
    .notice $nick Sorry, your nickname is not in my user user list. 
    halt 
  }
  if ($hfind(users, $2)) && (!$3) { 
    .notice $nick You didn't specify a password. 
    halt 
  }
  if ($hfind(loggedin_nicks, $2)) { 
    .notice $nick You are already logged in. 
    halt
  }
  if ($hfind(ulst, $2)) && ($hget(ulst,$2) == $3) { 
    .notice $nick Authorisation to user $+($chr(2),$2,$chr(2)) has been accepted, you are now logged in.
    hadd -m loggedin_nicks $2 Yes
    hsave -i loggedin_nicks loggedin_nicks.hsh 
    halt 
  }
  if ($hfind(ulst, $2)) && ($hget(users,$2) != $3) { 
    .notice $nick Password for account $+($chr(2),$2,$chr(2)) is incorrect. 
    halt 
  }
  if ($hfind(ulst, $2)) && (!$3) { 
    .notice $nick You didn't specify a password. 
    halt
  }
}

on 1:text:logout*:?: {
  if ($2) {
    if ($hfind(loggedin_nicks, $2)) { 
      hdel loggedin_nicks $2
      hsave -i loggedin_nicks loggedin_nicks.hsh 
      .notice $nick You have successfully logged out.
      halt 
    }
    if (!$hfind(loggedin_nicks, $2)) && ($hfind(ulst,$2)) { 
      .notice $nick You are already logged out.
      halt
    }
  }
}

on *:TEXT:*:?: {
  ;Commands if they're logged in
  if ($hfind(loggedin_nicks, $nick)) {
  ;A simple op me script, commands are sent to query.  Change if the ? to # if you want it in channels. 
    if (opme == $1) && ($me isop $2) mode $2 +o $nick
  }
}