I wonder what would happen, if the Danish government stay put after the 1st S-H war in 1848-51, and try to muddle through with the rather awkward construction of a Kingdom of Denmark in combination with the Duchies. It would mean pressure and unrest from both Danish and German nationalists, but with a Government diplomatic level above the OTL imbecile I guess it would be possible to divert Prussia to testing her expansion practices somewhere else. It is basically about sticking to the London agreement from 1852 – i.e. keeping the Duchies formally separated from the Kingdom, but through subsidies, investments, policies etc. motivate Danes to move Slesvig and Germans to Holstein.
So, if it works until a WWI ends as in OTL, I guess the political window of opportunity would be present for a solution parting the duchies along/as close as possible to language/nationality borders – as in OTL. But without the OTL Prussian rule from 1864-1920 German immigration into Slesvig will be much smaller or absent, but there might be Danes going to Slesvig. That could very well mean the Ejder being a language/nationality barrier between Danes and Germans more clear cut than the OTL one a little to the north.
Regards
Steffen Redbeard