Do not declare the variable inside the if statement? Variables are only valid within something called scope. Scope is a region inside your code, this can be a function, global or even just between some brackets. Google "C What is scope" for more detailed information.
The switch statement needs a variable not a value. See my example. case 0: means if the state variable has the value 0.
Check how logic in if() statements work. If (0x600 != 0x20) is always true. You want to compare a variable to a value or two variables to each other.
if ( a == 10 ) or if ( a == b ) but not if ( 1 == 2 ) even though the compiler will not complain because this is technically a valid C statement.
Please post your complete sketch using code tags.