Both Plugins scripts and commandline-embedded Lua scripts are loaded as coroutines into the gma3's Lua-engine, so the proper way to wait/delay would be to use coroutine.yield(), as this would halt your code only, and not block the whole Lua engine, (as some of the hacks suggested on stackoverflow would do)
Please note that yield takes seconds, not milliseconds, as argument e.g. coroutine.yield(0.1) for 100ms yielding