I think the #Define states at the top were confusing me
The #define bits are there to un-confuse you.
All they are are symbolic names for numbers. So, instead of trying to remember which number equates to which state in your head, you just tell the compiler that these names, or "macros", are to be replaced by the numbers (or whatever you specify) when it compiles. Then, instead of referring to "state 3", or "state 6", you can just use the understandable names you gave to the states.
So, where you write:
if(state==STATE_LED_ON)
the compiler actually sees:
if(state==2)
and you don't have to remember that state 2 is the LED turned on.