Solution 1:

Sleep is not for measuring milliseconds. It pauses your script for a certain amount of time.

From what I can see it is not possible to load any libraries from a Logitech script.

So you can only use Sleep or run a loop to delay.