To express delight that something went awfully wrong for someone (they might have had it coming to them or deserved it in someway, or you might dislike them). For example if an insult they used backfired.
Usually said after saying something smart or intelligent.
A longer version of the sentence is 'Up here for thinking, down there for dancing, out there for shaking and down here for making' Usually one would point to their head then feet for the shortened sentence. If lengthened one should then shake their hands and then point to their mid section while saying the last two things.