Two things come to mind here. Separate the halting function from the spam check code. Also, it's a good idea to strip codes from $1- to make sure you don't miss color-coded spam.
Code:
#adver on
on @*:TEXT:*:#:{
  if (($nick isop $chan) || ($nick ison #staff) || (webad isin $1-)) halt
  if ((www. isin $strip($1-)) || (http:// isin $strip($1-)) || (irc. isin $strip($1-))) {
    shun $nick Please no advertising!
    .timer 1 180 unshun $nick
  }
}
#adver end
For more help with protection script ideas, have a glance at protection scripts.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C