I think don't need the wait. The level lighting-capable dx9 dll already included in free lite-C package.

Download the lite-C MED and copy the dx9 dll to A6 folder.
http://server.conitec.net/down/med_setup.exe

But it is too slow for large level....OK for MED but not WED.