What they're saying in that command (if ABS(p1p#-ballx#)>50) is this:
First, it's the player's position - the ball's position
-or-
p1p#-ballx#
Then, they use absolute value on it. Why? Because that math operation could turn out a negative or positive number.
So if the player's position (p1p#) is
below the ball's, and I'm thinking on the Y axis her then the value will always be positive right? Sure.
But if the player's position is
above the ball's, then the answer would be negative.
Now what we're trying to find out is how far away the ball is right? Now, if the answer is positive, and the player's position is below that of the ball, then
if p1p#-ballx# > 50 works just fine. However, observe that if the player's position is above that of the ball, even if it was say 50 pixels away (which is what we want to find out), the value would be -50, not 50.
So then we apply ABS() to the calculation - if ABS(p1p#-ballx#)>50 - so that if the player is below the ball, ABS won't do anything, because the result is already positive. But if the player is above the ball, it will turn -50 into 50, which would find the actual distance in pixels between the ball and the player, in any direction, up or down.
Hope I make any sense.