Here's some more details:
http://www.w3.org/TR/xbl-primer/#scripts
What you're doing seems to be fine, here's the example they're giving:
<xbl xmlns="http://www.w3.org/ns/xbl">
<script src="example.js"/>
Note xmlns there, that's default namespace. If you have it defined as: xmlns:xbl="http://www.w3.org/ns/xbl" then you have to use
<xbl:script src="example.js" />
Try that, I never tried it personally myself but this namespace thing is common pitfall.
EDIT:
I'm afraid that this might not be possible. This is from XBL 2.0 spec, and Gecko doesn't seem to be supporting it yet, and in XBL 1.0 script tag does not exist:
http://groups.google.com/group/mozilla.dev.tech.xbl/msg/d7d4f279ebdad65f?pli=1
They are mentioning here that development should get into full swing.
Here's the link to which they are pointing to: https://wiki.mozilla.org/XBL2 but it seems that it hasn't been updated since 2009, it's hard to tell if this is even going to be implemented.
And here's XBL 1.0 reference where you can see that script tag does not exist: https://developer.mozilla.org/en/XBL/XBL_1.0_Reference
But to offer a possible alternative - you could use modules, and in constructor do something like this:
<constructor>
Components.utils.import("resource://yourextension/config.js");
For more on modules: https://developer.mozilla.org/en/JavaScript_code_modules
and example: https://developer.mozilla.org/en/JavaScript_code_modules/Using
Basically you'd need to register your modules folder put your test.js in it, follow the instructions how to "export" functions/variables from it. You can then import it to any JavaScript, XUL or XBL file.