What is the term for paraphrasing an idiom (for humorous effect)?

Solution 1:

The phenomenon you describe is related to the so-called anti-proverb, "the transformation of a standard proverb for humorous effect".

Although your examples involve transformations of idioms, rather than proverbs, the phenomena are similar enough that you might call your examples anti-idioms.

Wikipedia gives J. K. Rowling's "don't count your owls before they are delivered" (a play on "don't count your eggs before they hatch") as an example of an anti-proverb. This is very similar to your example of "Satan's lawyer" (a play on "devil's advocate"). In both cases, the humor is the result of substituting synonyms in the original expressions.

Another example might be "she kicked the pail" (a play on "she kicked the bucket").

But anti-proverbs and anti-idioms aren't limited to synonym substitution. Any wordplay on a proverb or idiom creates an anti-proverb or anti-idiom. For example, inserting extra words into a fixed phrase like "vicious circle" would count as an an anti-idiom. For example, "vicious Arctic Circle" (Lubin calls examples like this phrasal tmesis).