Help with certain parts of the meArm Code (for Joystick Control)

What it appears is happening is that idle is incremented whenever the function is called, and the joystick is centered. After some number of times, with no movement of the joystick the servo is detached.

Why the code was written that way is a mystery.