Are you trying to switch to a configuration where you have only an external monitor enabled? You can do that by setting up a set of metamodes with your different configurations:
Option "MetaModes" "DFP-0: nvidia-auto-select; DFP-1: nvidia-auto-select; DFP-0: nvidia-auto-select, DFP-1: nvidia-auto-select"
That should give you three options: one with only the internal display, one with only the external display, and one with both side-by-side. You can switch between them with xrandr.