The reason for the way out-of-range number in the first two lines is sort of a cheat in determining whether those values have been set to a location to move to. Line 6 uses that condition in the decision to set new coordinates.
As far as using abs: I guess it was a matter of choice (between using it and Math.signum). Either way, both the absolute value and the unary sign value were needed to complete the method.