Hello Koichi, very interesting your posts.
Have you thought about getting your work done specifically using function and Module[], so the definitions do not interfere with other lines outside the function? e.g.:
func[n_] :=
Module[{a, b, c, d}, a = n; b = n^2; c = n^3; d = n^4; {a, b, c, d}]
func[3]

Note that using the definitions after using the function they remain restricted only within the function:
{a, b, c, d}

Another thing that would be interesting for you to do is to merge all your posts into one function (a same function that finds prime numbers: above, below, twins, etc.) with options to switch between them, using OptionsPattern[], e.g.:
func2[n_, OptionsPattern[]] :=
Module[{a, b}, Options[func2] = {"Type" -> "Subtraction"};
a = n + 10;
b = 2*n; {a - b > 0,
OptionValue["Type"] /. {"Subtraction" -> (a - b), "Sum" -> (a + b),
"Divide" -> (a/b), "Multiply" -> (a*b)}}]

Module and OptionsPattern can be found in the documentation for a better understanding.