Before you go too deep down this path ...
Have you actually tested that changing the
deployment file during various points at
runtime actually has the desired effect?
What you need is a designed
test scenario that forces you to swap files - preferrably at different times for all the different reasons that have already been projected. Then you design the files by hand and simply copy the necessary file over the active file when needed. If everything works as hoped you can implement your dynamic system. I wouldn't be surprised it the test might uncover that the file overwriting approach does not work (in memory configuration cache, though there may be a way to force a reload). If all else fails you may have to make the configuration adjustments through the programmatic API.