I take this count is cleared each time sleep() or one of the other commands you listed are executed so this will never happen with code that has "enough" sleep creating commands in it?
AFAIK, no (the reason being that lua itself handles the counting can calling the hook)
There are several ways this could be improved, but it's probably not urgent. If you have script that it causes problems for, that would be a different story.
Urgent? No, I don't think so either. But two things come to mind:
Remote control codes. To overcome our limitation of only having 1 slow input line (USB supply voltage) which ubasic is able to poll with 10 ms period, some users have use pulse width to code commands. This "random" sleep occasionally causes 10 ms additional jitter to that communication. If I'm not mistaken, that won't be the greatest inaccuracy, though. Has anyone tried these scripts in Lua yet?
The other one is more of a research project. There's a thread out there somewhere with cyril4e (if my mind serves) and myself looking at an alternative for propcase 205/206 shoot status, to improve the information and get rid of problems with Ae lock, for instance. That test (sampling a value of a variable in the camera to find out what values it gets and when and for how long) could be done with much greater precision using Lua and maybe the new I/O commands, but a "random" 10 ms delay interferes. That can of course be worked around by changing something in the script to make it sleep at different times and running the tests again (which needs to be done anyway I suppose, it's just more convenient to know exactly when the script is asleep).