This is a good question... I'm not an expert enough, I encounter this need from time to time, and I haven't found a script for it. The solution I did and heard is to use Illustrator...
In fact for an answer: I would love to hear if it is a complex script or a number of simple commands?
In fact, Olav Martin Kvern did one about ten years ago and it should still work.
It's exploiting the text wrap feature of InDesign where one could define a custom path for wrapping text. Let's see if we can still find the script named OffsetPath.jsx.
It was part of Ole's CAD scripts suite. Ah, found it:
Hm. For your purpose you will run it perhaps two times on the same object to get the outer path and the other time to get the inner path and then use InDesign's pathfinder tool to create the desired object.
Just test OffsetPath.jsx and let us know how it goes.