The closest that you're going to get is being able to perform code on multiple documents based on a trigger of a single source.
For example, you can have your script contained in a Google Sheet file and when something occurs, even time passing, it will trigger and will run through all other files. There could be a work-around that you have a conditional statement check something in your documents and if it matches, run that code block.
Here's a scenario -
- 5 minutes passes -- begin code
- code checks document 1 for condition -- condition met
- code is performed on document 1
- code checks document 2 for condition -- condition not met
- code checks document 3 for condition -- condition met
- code is performed on document 3
- code completes
This would require an installed trigger, many, many if statements and some regiment to how those documents are read/ checked. It could also include a for loop in which you pull in an array of those documents and loop through each object, checking for the conditions you would have used to trigger those codes.
TL;DR You can't add code to another container, but you can pull multiple files into a single container, modify them with the code you intended for them, and save that new state.