Another thing: do fix the indentation of your code (CTRL-T in the IDE does this for you).
Missed that loop issue - good one. That's going to take a while indeed... 1630.9 seconds to be precise.
That may also explain some odd behaviour. The documentation of servo.write() is lacking, but I guess servo.write() expects to receive a byte (rather than an int, which is the type of pos). So the value goes to 180, then over 180 (presumably ignored by the servo.write() function), then when reaching 256 the byte overflows to 0 and the servo turns the other way.