The code is only writing High and Low to turn the LED on and off. DigitalWrite (pin, HIGH) and LOW would work just as well there. Probably better, as the code doesn't have to check that the pin is set up as an analog pin.
On a Nano, and some Prominis, A6 and A7 are analog Input pins only. A6 and A7 are wired to come out of the package on an Uno. A Mega has analog 0 to 15.