Instead of using counters
<h3 id="scene-1-1">Scene 1</h3>
a writer could incorporate upper level header content if necessary (ignore escaping for now)
<h3 id="scene-1-@-episode-1">Scene 1</h3>
<h3 id="scene-1-(episode-1)">Scene 1</h3>
However, this should really remain implementation-dependent unless implicit header references (Pandoc-style or what @an3ss proposed) were becoming a standardized extension.