The key aspect of the analogy is that you have compilers emit or JIT to JS, rather than writing if yourself, and then have languages/DSLs that users write to, rather than JS.
Yes. That's why JS is the target (and its ubiquity).
but if you were to design a browser language with this kind of usage in mind it seems you'd want something that was a lot easier to optimize than JS
JS isn't turning out to be too bad to optimize. Post-lower optimization already occurs in the browser. The part the compiler would do is optimization prior to emission to JS.
What other language runs in all browsers?