Looks like you're not giving the servo enough time to reach 180 at the slow pace before you order it back. Put a substantial delay between the two for loops. Why you're using those loops at all given the 180 degree increments is a bit of a mystery too.