Anyway, if you want to use your original code: there was a wrong syntax in the on join event.
The first opening bracket should not be in this line:
Code:
{ ban -ku600 # $nick 2 14Random Nick Detected }

And, imho it should be:
Code:
on @*:JOIN:#:{
    if (($israndom($nick)) && (%consonant == on)) { ban -ku600 # $nick 2 14Random Nick Detected } 
}

It's more clear to let for the script ban the user if 1) he has a random nick AND 2) the switch "%consonant" is toggled "on", than checking for "%consonant being off or no value for the %consonant switch at all, then do not proceed to the banning part". smile