I'm not sure that you understood mikeday's 9 Sep 2018 comment: that by using javascript such as that he linked to, Prince can already convert ASCII quotation marks to opening & closing curly quotation marks.
However, asking Prince or a javascript program to do this conversion has caveats in that if the ASCII input uses the straightforward scheme that ASCII apostrophe can represent either opening or closing single curly quote, then there isn’t always a unique valid conversion: ASCII « 'and » might represent either the start of a quotation or the word ‘hand’ with an elided ‘h’. Similarly, testing for presence of a matching closing quotation mark is unreliable because of an ambiguity with apostrophe of either another elision or of possession after a word ending in ‘s’, or because of the convention of using an unmatched opening quotation mark for each subsequent paragraph of a multi-paragraph quotation.
Also, as you point out, ASCII quotation marks should sometimes not be converted to curly quotes at all, but to measurement marks (u+2032 ′ and u+2033 ″), or should occasionally even be retained as ASCII quotation marks, in a passage that's actually discussing something typed.
Some alternative solutions:
- A lot of the software used by book authors for creating text (Scrivener, Ulysses, most word processors) allow converting typed ASCII quotation marks to curly quotes as one types. Such software still faces the same ambiguities as discussed, so it’s up to the author to notice when the software makes the wrong guess (or to learn the cases where the software gets it wrong, and to type something slightly different accordingly, and later do a global search and replace).
- Some input methods built into your windowing system can do the job. iOS has a "smart punctuation" option. X11’s built-in simple input engine can replace chosen strings of key presses with chosen corresponding textual strings (man XCompose).
- Regular expression find-and-replace, using interactive replacement for the ambiguous cases. (This assumes that you have a text editor that allows interactive replacement of regular expressions. Emacs is one such text editor, though it’s somewhat heavy-weight if you haven’t used it before and don’t intend to use it other than for this one task.)
- Whatever method you used to create those em dashes in your post.