You want an ACS freecoaster, although I don't think they make em anymore. With the turn of two little screws, you can alternate from freewheel and coaster brake. I used to have one...many years ago on my freestyle bike. It was a very cool contraption that works with a standard coaster brake.
they pop up on ebay from time to time...