You can simplify the code to this:
On @!*:JOIN:#: { .notice $nick 12Welcome to the $chan $nick $+ ! mode $chan +o $nick }