The text is a proverb advising that if one must associate with dangerous people, it is best to keep one's distance. It does not play on different meanings of a word or similar-sounding words for humor.
If you sup with the devil , use a long spoon .