You can’t customise line styles. Only built-in can be used.
A workaround is to design your object either in Draw (with somehow limited possibilities unless you create combined shapes and use Format
>Text along Path
) or an external program. You then paste the resulting object into Writer (and position it relative to its anchor point with a frame style).
Take care about a common misunderstanding about text boxes. Usually, they will not do what you expect. Text boxes are simple graphical decorations, just another shape, which you’ll have trouble to control interactions with text.
The adequate “object” is rather a text frame where interaction with text is accurately and predictably controlled by a frame style (but it is a concept difficult to master).
Unfortunately, frame borders have the same limitations: you can use only built-in ones. Then create a box (pure graphics, without text) you’ll anchor to the text inside the frame with the required aesthetics. Doing so will move the border with the frame.