Put it at the start of the escape, right before the fall or capture, then follow it with a sad trombone for the failed getaway and a sitcom laugh track to close the scene on the joke.