I'm not sure I understand exactly what you want. In the first case, your javascript file can access window.paper to call functions on the project, e.g., window.paper.project.activeLayer.remove();
Second, if you are trying to access functions that you defined then your above example works...as long as the paperscript file has been loaded and parsed before your javascript runs.
To get around that, I just followed this answer
http://stackoverflow.com/a/7247912/783037 : At the end of your paperscript file, paper.pjs, call a function attached to the global object, e.g., window.paperscriptLoaded();
Then in your javascript file, main.js, define that function so that it calls the code you need to run, e.g., window.paperscriptLoaded = function() {window.view.paint();}
~Ryan