Follett: C2 exports a single JS file (which can even be minified) and acts as a "single application". I mean, objects are sealed and will work only within the context of the C2 application, it is likely that you can't use functions from the app in your page, and in the same idea you can't program function in your page and use them in the application.
Either you program all your application in C2 and export as a "single application" that you embed in your page with no other interaction then displaying it, or you fully program your game in JS, out of C2, and then the C2 application has no way to access/use said code.
Edit: a last resort could be the use of ajax (to get informations from a database for example) and to program a quick C2 plugin that would execute JS' "eval" function. This way you could feed JS to the plugin and have it executed in the context of your app.