How to temporarily route queries originating from 1 script run to a different database with the same model structure?

That’s going to be tough.

As you’ve identified, if you’re calling external libraries that are making queries, you don’t really have any effective means of controlling those queries.

So my first reaction to this would be to spin this action off into a separate task, where that task is launched with a different settings file having a different database default. (What mechanism you use for this may depend upon how frequently this is going to be done. You could set this up as a Celery task, but it’s not necessary to do that. You could just run this as an external process.)