The PBP help file for the AND statement says.....
Be sure to use parenthesis to tell PICBasic the exact order you want the operations to be performed.....

That means your original statement should look like.....
IF (X=1) OR (X=2) THEN....

HTH
BrianT