What I'm trying to do is on join, have a script examine whether that person was voiced, halfoped or oped, and then proceed with the if elseif statements. In order to properly use the command, I need the script to be delayed about 5 seconds so Chanserv can properly voice or op someone. So far I have managed this.

on *:join:# {
if ($nick isop $chan) {
/mode $chan +o $nick
}
elseif ($nick isvoice $chan) {
/mode $chan +v $nick
}
else {
/mode $chan +h $nick
}
}

So I want it to half anyone who doesn't have autoaccess. How can I cause a delay before the if is read?