Plans were made for whole of Scandinavia
First thing we need to notice is that Armee Norwegen controlled not only German troops dispositioned in its namesake country (Norway), it also controlled troops in Finland, participating in invasion on USSR. Also, it did contain troops that could be possibly used against Sweden. As such, it had effect on whole of Scandinavia.
Before we discuss situation country by country, let's first examine number of divisions in Scandinavia, during the war. As we can see, it started as just 7 in 1940, but quickly increased to 11 and then 13, as invasion of USSR started because troops were sent to Finland and from there to Soviet soil. In 1943 number of divisions reached 20, with now increased number of troops in Norway (as deterrence against invasion, and as warning to Swedes ). This remained until half of 1944, when Finland was forced out of the war, and German troops from there withdrew to Norway. Number of divisions gradually dropped (to 11), as some of them were pulled back to continent. It could be assumed that late in the war these divisions did not have full complement of men, and were usually lacking heavier weapons like artillery and especially armor.
According to some sources, at 10th of May 1945, German forces in Norway numbered 327 393, but this included Heer, Luftwaffe, Kriegsmarine, SS (not just Waffen SS, but also Gestapo and other members) and even Organisation Todt, Transportflotte Spee and other semi-civilians. Obviously, these were mostly not first-class combat troops. Units fit for combat were prioritized to be sent back to Germany via Denmark.
Now let's briefly examine mission of these forces regarding various Scandinavian countries:
Finland : Finland was springboard for invasion into USSR, and initially Finns had great plans, hoping that Germany would quickly defeat and destroy USSR. Finns and Germans aimed for Murmansk, and Finnish army supported German drive towards Leningrad. However, as invasion stalled in late autumn/winter of 1941, Finnish attitude begun to change. Finland had initially mobilized large part of its male population for the invasion, and this could not be economically sustained. Therefore, form early 1942, until Soviets forced Finland out of the war, Germans had to keep certain number of troops on Finnish front. These strengthened Finnish resolve to fight, or at least to hold certain part of frontline against Soviet Union and tie down Soviet troops that could be used elsewhere. Potentially, these troops could intervene in case of Finnish betrayal. In the end, this ended with Lapland War.
Sweden : Sweden was of course important for Germany due to resources like iron ore, but also strategically, because with benevolent Sweden Germans controlled Baltic Sea and northern "soft" side of Germany was not exposed for potential attack. Germans had high hopes for Sweden, and wanted to include fellow Germanic nation into alliance. This almost happened in summer of 1941 when German troops were allowed to cross Swedish territory going into war against USSR. In the end, Sweden remained formally neutral, but many of its citizens volunteered for the formations like SS-Panzerdivision Wiking. However, as situation in frontlines begun to change, Sweden leaned more towards Allies. Germans troops had a mission to at least dissuade Sweden from openly siding with them. Such situation essentially remained till the end of the war.
Norway : Finally, we have Norway itself. Reasons for holding and defending Norway are numerous. First, you would have control over Norwegian Sea and eastern part of North Sea, with access to Atlantic Ocean. Second, having control over Norway and Denmark would effectively isolate Sweden from Western Allies, and force it into semi-alliance with Germany. Same goes with Finland, plus it allows supply of forces in Finland. Third, it is much easier to defend northern borders of Germany in Norway then in Germany itself, especially with potentially hostile Sweden.
In the ending days of the war, German decisions were torn between strategic concerns mentioned above, dire military necessity and unavailability of transports and other logistic needs that could transfer all of German forces back to Germany. Therefore, they did what they deemed best for them in such circumstances.