Changing modes with one touch button; on-mode1-mode2-mode3-off-on-mode1, etc.

How do I write a "loop" inside the main loop?