The text appears to be a proverbial expression suggesting that evil (or temptation) can be avoided by not allowing it an opportunity. It does not play on different meanings of a word or similar-sounding words for a humorous or rhetorical effect.
Away goes the devil if he finds the door shut against him .