I think the best way would be to let Frederik VI die earlier (maybe around1820), which would bring Christian VIII on the throne while he still "young" and reform friendly, the lack of the popular Frederik VI would also make a revolution in 1830 more likely, which could result in democratic reform before Nationalism became a dominating factor (and before Frederik VII could fuck it up), and while people still had a positive view of "helstats Danmark". Beside that Frederik VII need either to be more fertile (one his two first wife need to produce a heir) or he need a brother to inherite the throne.
But you still have the problem of German Nationalism and the Rittershafts unwillingness for democratic reform - well more the latter than the former.