For loops require 3 elements, an initialisation, a condition and an increment (or decrement)
The initialization happens first and only once. Each time through the loop, the condition is tested; if it's true, the statement block in braces, and the increment is executed, then the condition is tested again. When the condition becomes false, the loop ends.
Looking at one of your for loops
for(servopos < pos; servopos = pos; pos +=1)
The initialisation is done by comparing 2 variables and the answer will be either 0 or 1, but it is not assigned to a variable
The condition sets one variable to another instead of comparing them
The increment adds one to a variable that has not been initialised in the for loop
What you need to do is to compare servopos and pos to determine which way the servo needs to move and then, separately from the comparison move the servo appropriately using a for loop