I created a project recently where I moved all my js code to an external file, the way I got it working in edge animate was to add the following to my external js file.
var customVarName = AdobeEdge.getComposition("EDGE-106073131"); // Change to EDGE composition class name to your projects class
//Then add the following to target the root stage objects
var customStageName = customVarName.getStage();
//Add more code here
I then added the script toEA in the normal way using the scripts panel.
This is quite simple method that worked for me but if anyone knows a simpler / better way then I would love to learn it.
Thanks a lot for your input, at least now I have somewhat of an idea on how custom js works.