Reversible redox reactions in metal-supported porphyrin: the role of spin and oxidation state