then //How do you declare “then” in this scope?

This:
if (digitalRead(A1) = HIGH);
{
switchPin 6 == HIGH;
}
Should be:
if (digitalRead(A1) == HIGH); <-----<<<<< two =
{
switchPin 6 = HIGH; <-----<<<<< one =
}

There is no function called: then()
int then(); <-----<<<<< Tell us what you think is happening here.

then == switchPin; <-----<<<<< use one = but you should use names that mean something.

You really should master some of the basic examples that are installed with the IDE.