It may not be evaluating exactly how it looks like it should. Try
or
Putting debugs in that might help you work out what's happening.
If (EntityDistance(guy,pivot1) < 19) And (EntityDistance(guy,pivot2) > 20) Then
or
if (EntityDistance(guy,pivot1) < 19) then if EntityDistance(guy,pivot2) > 20) Then ;do stuff endif endif
Putting debugs in that might help you work out what's happening.