The delays count the times the loop has ran.
No, they don't. YOU are counting the delay()s. Stop that. Note when something of interest happens (by calling millis()). Note when something else of interest happens (hint: it's the same way). The difference between the times is the interval of interest.
Regarding my comment of switching positions, there are five different sections, potentially confusing to inexperienced users.
You think that comments that don't match the (incorrect) code will make it clearer? Wanna buy a bridge?