I don't think you can have a trigger in C2 "on load" for this.
But you could, after the first execJS action where you happen the script, activate a group in C2. This group would just have one event, a condition checking in the FunctionA is defined. Once this event gets triggered (aka the library is loaded), you can call a function in your events that will handle the next steps, and un-activate this group.
Or you could have your external script do an action on load, like simulate a click on a button. If you added this button in C2 (setting an ID, making it invisible), the event "onclick" (the C2's one, in the event sheet) should be triggered.