Browser paste events unfortunately don’t come with modifier key info, so the only way that I’m aware of for doing this is to use key events to track the status of the meta key (which is hard to do reliably, but corner cases like switching focus while holding a modifier key tend to be rare, so might be good enough).
That’s kind of weird. I’m assuming that must be how Google Docs and other editors do it, so hopefully it will work okay. Will report back once I’ve tried it out.