I don't see anything beyond the $readini which could possibly cause such a delay, so my guess is that you have a different script doing something during ON JOIN where the delay actually happens
You can confirm which line has the delay by having the 1st line of the event be:
var %ticks $ticks
and then sprinkled through the event you can have lines like:
echo -s debug $scriptline interval $calc($ticks - %ticks) ms
... and if you see a jump between a pair of debug messages, you know the delay is between them.