In the past, I had some problems with SysWait().
I think you should use a timer.
viewtopic.php?f=3&t=36667&p=218689&hilit=syswait&sid=baaa9792d603f7acacf7427eeacfd234#p218689
I tested your suggestion with syswait in a loop, and it's consuming 25% of the CPU.
I can't recall precisely, but I believe it blocks the program.
Best regards,
Otto