Switching an Output to opposite to last status

You can read outputs, so you could do.

digitalWrite(13, !digitalRead(13) );