I wonder if is possible to set a timer in this line: on connect there's an initialization that need about 20 seconds. So an user may skip the warn.
Hmm... It is not entirely clear what could be causing such a long initialization. Logically, the script should work immediately after the bot enters the channel, and should immediately check all users joining the channel. This should not cause any lag unless it depends on the settings/load of the IRCd network you are on or if your bot is using too many complex unoptimized scripts that are causing some lag. In this case, you can try moving this script higher in the run order list. Also, to check, try running this script on pure mIRC without other installed scripts.
And of course you can try adding a timer to send a notice message to each user. Only for correct operation, you need to add the user's nickname
$2 to the name of the timer so that the name is unique and the timer is independent from other similar working timers:
else .timerCU_WARN $+ $2 1 20 .notice $2 Please, register/identify Your nick! Thanks
I hope this helps you and you find a solution to the problem, because when I tested the script, everything worked quickly, without any delays.