PLUS: There is an extra closing brace in the join event, so the ctcp event won't even be triggered.
^ There is the error.
Check that your opening/closing braces are matched. You can use the {} button in the script editor to check them.
Code:
on @*:join:#:{
if $($+(%,ctcp,.,$chan),2) && !$($+(%,version.check,.,$fulladdress),2) {
.ctcp $nick VERSION
set -e $+(%,version.check,.,$fulladdress),2) $chan
}
}
} <---- This one should not be here!