Can I write a plugin for discourse, to appear only in the Discourse comments on my own web site, and still use the hosted Discourse service? Or would I need to run my own Discourse server instance for that?
Can a plugin I write present a pop-up menu which a user can use to choose text to be inserted into the comment the user is writing?
You would need to be on their enterprise plan.
An easier solution would be to add to the composer. You can do that with a theme component (here is an example: MD Composer extras, but you might search for others closer to your application). With a theme component you would not need a plugin, so any of their plans would work.