Maybe a little from left field (is that expression known universally in English?) but it occurs to me you could achieve the desired look (as per your example shown, Johan) by using two single-cell tables, one within the other. Use the dotted border on the top and bottom borders of the outer cell and the solid ones on the top and bottom of the inner cell.
By adjusting the Cell Inset values of the outer cell (Table/Cell Options/Text…), you can control how close to each other the two borders appear. The left and right insets of this cell should, of course, be zero to bring the ends of the solid borders as close as possible to the ends of the dotted borders.
Your text, of course, goes in the inner cell and its Cell Offset values will determine how far the composite borders appear from the text. Centred text is obviously going to work best in the example you gave us. Other alignments would also work but you may need to adjust the left and right margins of the paragraph — or possibly the Cell Inset values of the left and right.
I had a few back-track steps in trying this out and suggest you set up the outer cell (table) completely before you place the inner cell (table). otherwise it is almost impossible to get back into that outer cell to make any further adjustments. I found I needed to delete the inner table before I could do so.
I haven’t tried this, but it occurs to me as I rite this that a single table (the one I have been calling the inner table) could simply be placed in its own text frame (it has to be in one anyway) and the dotted borders applied to the text frame. You could define the text frame with its own object style and the table it contains with its own table and/or cell style. That way you could repeat it whenever you wanted to without too much fuss and bother. Mind you, I acknowledge that it doesn’t solve the path problem, but maybe someone else can pick that up.
OK, I’ll slink back to left field now . . .