I tested this code with the non event prefixed on join and the raw events with both a nickname of 2 characters and a nickname with more than 30% of uppercase and it triggered a badnick_alias alias I had created to test the code. Feel free to join the channel in my signature if you want further help as there could be any kind of reason as to why it's not working for you, and figuring it out on a forum is more complicated than on IRC.