There were several royals in the 1800s not only entertaining the idea but also working actively to become sole ruler of all Scandinavia. Their ideas were more likely sprung out of personal ambitions than any nationalistic fervor as opposed to that found amongst students and other people in the pan-Scandinavian movement.
I believe it would have been close to impossible to achieve a unification in the 1800s. A unified Scandinavia, although too weak to stand alone against any great power of Europe at the time, would still have been considered a threat if in an alliance with an opposing side in a conflict.
It could have happened before, as pointed out, and it can IMO happen in the future if the following prerequisites are met:
Unification as
Scandinavia. The terms Danish, Swedish etc are to firmly set at the moment. People accustomed to being "Danes" or "Swedes" would probably have a hard time digesting being called the other.
Politician(s) or lobbyists that are willing to work tirelessly with showing the idea as being
realistic. (Surveys show that a majority of the people, in all walks of life no matter what gender or profession etc, consider it a good idea - except for members of parliament

)
I believe Scandinavia would need the backing of one or two of the bigger European players or by the USA, because I'm sure some others would act against such a thing ever happening.