for(pos = 20; pos < 100; pos += 1) // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
Without braces, the only command execute in the body of the for loop is the myservo.write() command. Since that is a non-blocking function, the for loop completes very quickly.
You want curly braces around the myservo.write() and delay() calls, so that the servo moves a little, and waits, then move some more, and waits, until it has moved enough.