This should give you an Idea:
Code:
mode var byte
mode_switch var gpio.3

start:
if mode_switch = 1 then
mode = mode + 1
else
 goto main
endif

main:
if mode = 0 then
goto normal
if mode = 1 then
goto burst
if mode = 2 then
goto rapid
if mode = 4 then
mode = 0
else 
goto start
endif
endif
endif
endif
normal:

rapid:

burst: