You could try a script attached to a top level node, then recursively iterate through all it's children and assign the shader as override to any node with the appropriate method but oh boy do I see this being slow. You are better off just assigning it manually via editor for best results.
You could also try developing a editor plugin for this perhaps but then if that was within your grasp you probably wouldn't need to ask in the first place.