Triggering a servo to repeat an action

Thank you for the advice.

I modified another set of code and the serial.print is from that code. I am unsure what it is doing.