Maybe you were looking for...

How can I toggle between two blocks on button press with a command block?

I want to change a concrete block from red to green and vice-versa, when players click a button. How can I achieve this with a command block?