A: 

Entities are handled in the XML parser. This means you can only refer to entities in XML files. So I assume that rewriting your example to something like the following would work.

In your xul file:

<script>
var myentity = "&myentity;";
</script>
<script src='myscript.js'>

In your myscript.js:

alert(myentity);

But... for scripting convenience XUL may treat <script> differently, which would break entity resolving.

Laurens - Xopus