If you are using the POT command, then you do not want to make the pin
an analog input. It needs to be configured for digital I/O.

Change this: ANSEL = %00000100 ' MAKE GPIO.2 ANALOG
To this: ANSEL = %00000000 ' MAKE GPIO.2 (and all other A/D pins) digital.

Why?

Because the POT command requires a pin it can control by flipping it from
output, charging the cap, then flipping it back to an input. If you have the
A/D feature for that pin enabled, then the pin no longer functions as a digital
I/O-pin, and the POT command will fail.

If you prefer not to use the POT command, then you could use the ADCIN
command. In that case you would want to configure the pin as an analog
input with ANSEL = %00000100 ' MAKE GPIO.2 ANALOG