I only got the time to look into this now.
Let me try to understand better what the purpose of this preprocessor callback is.
From the code changes in the patch I gather that you are using it to collect all the script files before they are sent to the script compiler, so that instead of compiling the script you do something else with it. But you're otherwise not using it to modify the processing in the builder.
It doesn't really look like something that would be best solved with a callback. Wouldn't it be better to just have a flag in the builder to tell it to store the script content rather than compile it, so that the application can then get this content after the preprocessing has finished through some get calls? I can see that being useful for debugging the preprocessing step, or in your case, to store the preprocessed files as a single file.