door lock with Arduino and a servo

but want to change the servos going the other way

Servo.write(180 - thePos);

(Assuming a 180 degree servo)

and that the time before he locks again getting longer?

Assign a different value to timer. You'll probably have to change the type of timer to long.

Why are you detaching and reattaching the servo? That has no impact on the amount of energy it uses.