You just need to change the position of the door half as much as you are resizing it. The code should look something like this:
while door.Size.Y > goalpart1.Size.Y do
wait()
door.Size -= Vector3.new(0,0.1,0)
door.Position += Vector3.new(0,0.05,0)
end
while door.Size.Y < goalpart2.Size.Y do
wait()
door.Size += Vector3.new(0,0.1,0)
door.Position -= Vector3.new(0,0.05,0)
end