Add quotation marks to scriptwriting paragraph

I have defined several scriptwriting elements or styles. For some of them I want Scrivener to automatically add quotation marks to the paragraph. This is how I have it set up at the moment:

Script Settings > Paragraph > Options > Add prefix when compiling: QUOTATIONMARKS
Then, in my Compile settings I use these replacements:

  • Replace (?<=QUOTATIONMARKS)(.+) with „$1“ and :ballot_box_with_check: RegEx, :ballot_box_with_check: Case-Sensitive
  • Replace QUOTATIONMARKS with and :ballot_box_with_check: Case-Sensitive

This works fine. (Yes, it could be done in one step, but then the paragraph somehow inherits an underline from the previous paragraph.) Except, the paragraph loses all formatting. So any words that are bold or italicized, even inline comments, everything becomes the same main style of the paragraph. That is because the paragraph basically gets copied and pasted in the first replacement rule.

Does anyone have an idea how to automatically add quotation marks to a paragraph more elegantly in a way that preserves formatting?