It sounds like the issue here is that from the standpoint of that (at this point unknown) operation you want to perform, you don't want to
create a time delay, you want to
measure one. The thing to do is create a shift register on your while loop and initialize it with the current time using
Get Date/Time in Seconds. Now inside the loop call
Get Date/Time in Seconds again and subtract the value in the shift register from this function's output. The result is the time in seconds between rigth now and when the loop started. So do a comparison to see if the difference is greater than 5. Next, because you probably want this process to continue with the output of this logic going true every 5 seconds, add code to pass the time value from the shift register to the right-hand node of the shift register if the comparison is false but passes the new time value if the comparison is true.
A couple general comments: When creating LV code neatness counts. The idea is that you don't just write code you also have to be able to test it and debug it, and these jobs get very difficult if you can't tell where wires are going because they run over the top of one another and under things or the wires don't visibly connect to tunnels (as in every one of your little case structures). Likewise you need to be thinking in terms of creating reusable bits of code, so be on the lookout for places where you are doing the same thing over and over again - like every one of your little case structures.
Finally, I haven't followed the logic through completely, but it looks like all you are really doing in the mass of case structures is determining what the delay value should be based on the value in a shift register. I seems like that whole mass could be replaced with better (i.e. much simpler, more readable, more maintainable) code. For example, the value in the shift register can only have one of 13 values: 0 through 12. Therefore create a numeric array with 13 values in it, where element 0 is the delay value for 0, element 1 is the delay value for 1 - and so on. Now wire this array to the array input of an array indexer, and the value in the shift register to the index input of the array indexer. The output of the indexer is your delay.
Mike...