Short version
How do I automate changing multiple display settings? NVIDIA, 3x monitors (2x DVI and 1x HDMI), GPU only supports 2 active monitors.
Although this is may not meet your requirements, I did run in to this problem when using my laptop to power several monitors, and I ended up using the Display Profiles feature in UltraMon. I never scripted it or used their SDK, but I do know that they do support automation and SDK access.
Note: I am in no way affiliated with UltraMon, I just used their product and found it to meet my needs.