different action based on the number of times a button is pressed

UKHeliBob:
I cannot begin to imagine what it does with (pos = 13) etc.

The return value of pos = 13 would be 13, so

myservo1.write(pos = 13);

is functionally equivalent to

pos = 13;
myservo1.write(13);

It may be bad form, but it would actually work.