Background opening and closing multiple files sounds like the Orchid package. There’s a good number of threads regarding different workflows with this package.
As far as I know (since I couldn’t get Orchid to work due to some dependency issues in the past), you should be able to do most things Dynamo has normal access to within the background file. I am not sure if this includes postable commands.
This post suggests there are limitations, but that was back in '18. @john_pierson ?