PaulS:
Why is the relay connected to analog pin 12? Analog pins are input only. You can't perform a digitalRead on an analog pin.
Yes, since you are wiring to Analog Input 2 and 12 you need to say that:
// Constants:
const int SwitchPin = A2; // the pin that the switch is attached to
const int RelayPin = A12; // the pin that the relay is attached to
I'm pretty sure A2 can be used as an digital input/output. Not so sure about A12 since A6 and A7 CANNOT be used for digital I/O on those processors that have 8 analog input pins (surface mount 168/328 processors).
Instead of changing the code to match the wiring it might be easier (and make more sense) to change the wiring to match the code. Move the wires from A2 and A12 to 2 and 12.