The point is to close the pull request when the build result is not SUCCESS, so the logic should be:

Positive:
IF (result.success==FALSE AND configuration.autoClose==TRUE ) THEN closePullRequest

Negative:
IF (result.success==TRUE OR configuration.autoClose==FALSE) THEN doNothing

Your gist seems to close pull request when result is success or build is configured to auto-close pulls, and that could be wrong: a developer sends you a pull request whose build succeded; it would be automatically closed even if project's owner didn't merge it.

To reverse logic, I suggest doing the positive style, but as you said, is a personal preference :)