First, you mistakenly have M8 for both mist and flood in the first section.
Second,
Code M8
should be
Code "M8"
Third, just set the delays in Ports and Pins, Spindle page.
Fourth, you're turning on Mist and Flood at the start. Then, you're checking for a condition, and turning them on again. But, they're already on??

So the If ... Then section doesn't really do anything.
And last, either should work. You can also use:
If GetOEMLED(24) then
....
...