These kinds of sentences illustrate chiasmus:
In rhetoric, chiasmus... is the figure of speech in which two or more clauses are related to each other through a reversal of structures in order to make a larger point; that is, the clauses display inverted parallelism.
This passage mentions only clauses which showcase inverted order, but sub-clausal constituents like phrases can also exhibit it. Oxford Dictionaries captures this looser definition:
A rhetorical or literary figure in which words, grammatical constructions, or concepts are repeated in reverse order.
[NOTE: Some people use the word chiasmus for any repeated but inverted structure, regardless of whether the same words are used. They use antimetabole for the stricter notion which involves repeating the same words.]
Here is an example from T. Kane's The Oxford Essential Guide to Writing:
- If there had never been a danger to our constitution there would never have been a constitution to be in danger.
Here are some examples that I constructed resembling yours:
- Should I bear the punch or punch the bear?
- He kicked the duck and ducked the kick.
Generally, if you have two words that are both ambiguous between nouns and transitive verbs, you can construct examples like these.