One small point: the ($nick isreg $chan) is useless in an ON JOIN event, since all nicks are regular users at the time of joining, so that condition will always come back as True.
Here's my recommendation:
on !*:join:#:{
if !$istok(%welcomed,$nick,32) {
.msg $nick Welcome to our channel
}
set %welcomed $addtok(%welcomed,$nick,32)
.timer 1 5 set %welcomed $remtok(%welcomed,$nick,1,32)
}
The main difference here, is that if you get a lot of people joining quickly, this would still prevent someone joining/leaving/re-joining within the 5 second time period.