Here's how I would try it!
On your button:GUI Button sends event "press"
On "press" adds 1 to a global int variable named "material index"
On your object:State 1 can be "idle". Use the "int changed" action. When it changes, pass to State 2.
State 2 uses the "int compare" action, once for each new material state:
If global variable "material index" = 1, pass to state "green"
If global variable "material index" = 2, pass to state "red"States "green", "red", etc use should use the "set material" action. When finished, they should pass back to the main state.