You have a couple of things going on. You have a 125 ms Wait timer at the top. So your entire loop will take at least 125 ms per iteration. You have a 500 ms wait until next near the bottom. That basically runs in parallel with everything else. So that will run dead on every 500 msec slot of the computer clock. I'm not sure why you have the divide by and remainder operations. That will always return a 0 because 500 always comes out of the metronome and dividing by the same value should always return a 0 remainder, which has a 0 for sign, which when ORed with a 0 returns 0. So all of that is just enforcing a dataflow causing the data to be put in the queue after the 500 ms slot has passed. Once all of that is done, however long it takes, the loop ends and goes back to the beginning where the DAQ read will happen again, so the timing between DAQ reads will vary depending how long that takes to run.
I would make a backup copy of your work. Turn the 125 ms at the top into a 500 ms. Get rid of the 500 ms wait until next and all the math and comparison and the case structure. Just queue iup the data when you get it. The Wait 500 ms guarantees the loop will take at least 500 msec to run. If all the other code running in parallel gets done first, then the loop will just pause until that 500 ms timer is up. If the code takes too long, then the 500 msec timer will expire first and the loop will take as long as it needs for the code to finish.