Only support using me. The 'extra flexibility' is unnecessary and distracting. If users want a different selector then they can edit it, it's only 12 lines of code.
Use data attributes to identify the parent scope id and select it; this is less likely to interact with existing css tooling and classes, and makes it easier to identify by eye.
Combine parent and child scope id assignment and currentScopeId increment, reducing the size of the script by 2 lines.
Only creates a parent's scope id once, multiple scoped style children will share the same id.
Adjust the regexes to be more selective about what to replace
me
. The 'extra flexibility' is unnecessary and distracting. If users want a different selector then they can edit it, it's only 12 lines of code.