Hi!
1) You can put your JS code into the Custom JS field of theme tweaker module (System settings > Look & feel > Custom JS in admin area).
2) if you were provided with code like <script src="http://path.to/some/script.js">, it would not work out, because this is HTML code actually and you need to apply the approach descirbed here:
http://kb.x-cart.com/display/XDD/Step+4+-+working+with+settings
3) You can also include JS code like this:
http://kb.x-cart.com/display/XDD/Adding+CSS+and+JS+files