The problems of East Germany and North Korea are very different.
After World War II, the allies divided Germany into four parts, administered by the United States (US), United Kingdom (UK), France, and the Soviet Union (USSR). The US, UK, and France later merged their parts into West Germany. The Soviets turned their part into East Germany. The key point here is that the partition was mandated from outside. It wasn't based on divisions in Germany.
By contrast, Korea was governed by the Japanese at the end of World War II. It was not occupied as a defeated power but as an ally. It chose to partition by forming a US-backed government and a USSR-backed government. There was a war. The result of the war was a formal division into two countries.
Beyond all this, North Korea is effectively a dictatorship. The Kims make relatively unilateral decisions about how things will go. East Germany was more democratic. As the Soviet Union was collapsing, East Germany chose to reunify, democratically, with West Germany. North Korea has shown no interest in unifying with South Korea as anything but a ruler.
Another issue is that the Soviets were in no position to stop Germany from reuniting. They were collapsing at the same time as Germany wanted to reunite. In fact, a movement to reunite Germany existed before the Soviet Union officially collapses. China opposes the reunification of the Koreas. China believes that there is too high of a chance of the resulting country being an ally of the US. And that would put another US ally on their border, close to their urban centers.
China artificially supports the existence of North Korea. Otherwise, it would collapse. But China has never occupied North Korea. That was the Soviets. China also doesn't want North Korea to collapse because they worry about an influx of refugees.
East German sanctions
East Germany may have been targeted by sanctions as part of the eastern bloc. But once it was independent, it rapidly moved to unification with Germany. At that point, there would have been no reason to sanction it. Further, it never attempted to build nuclear bombs, so there is no parallel to the current sanctions of North Korea.
TL;DR: East Germany was not targeted by sanctions as an independent country.
- Prior to 1945, East Germany was part of Germany. Not an independent country.
- From 1945 to 1990, East Germany was occupied by the Soviets and part of the eastern bloc (Warsaw Pact). Any sanctions on East Germany were also on the rest of the eastern bloc. An occupied country rather than an independent country.
- In 1990, East Germany was briefly an independent country.
- After 1990, East Germany has been part of Germany. Again, not an independent country in its own right.
During the extremely brief period when East Germany was an independent country, it was doing things that the west wanted it to do. It wouldn't have been sanctioned.
Germany (West, East, combined) does not have nuclear bombs. It's not trying to develop them. In particular, East German was not trying to develop them during the period when it was an independent country. When East Germany was part of the eastern bloc, it didn't need to develop nuclear weapons. The eastern bloc countries were under the Soviet nuclear umbrella. East Germany didn't separate from the Soviets enough that nuclear weapons would be useful until it was rejoining West Germany.
North Korean sanctions
Finally, North Korea is building nuclear bombs and attempting to build missiles to deliver them. This is dangerous. North Korea is perennially cash-short. Even if they don't use nuclear weapons, it is easy to envisage a situation where they trade nuclear weapons to a middle eastern state in exchange for oil or cash.
North Korea also engages in extraterritorial actions in contravention of international law. For example, Kim Jong Un had his brother assassinated. Or the Sony hack. We don't know what actions they might take with nuclear weapons. We only know how they've used previous weapons.
China has some influence on North Korea, as China subsidizes North Korea. But if North Korea were as controlled by China as East Germany was by the Soviet Union, there would be no need for North Korea to develop nuclear weapons. China already has them.
I suppose it's possible that North Korea is acting purely as a front for China, but then it's unclear what China hopes to gain by the illusion of independence. It would see more to their benefit to openly control North Korea.
Might East Germany have also taken actions that the US didn't like? Sure. But the US, at that time, would have regarded such actions as being part of East Germany's role in the Warsaw Pact. The US would have levied any sanctions on the eastern bloc as a whole. If the Soviets had claimed that the East Germans were acting on their own, the US would have laughed at them.
This isn't excusing the East Germans. It's a simple result of how the Cold War worked. At that time, the US would have rejected any claim that any Warsaw Pact country was operating separately from the Soviet Union. Even if the East Germans had engaged in a separate operation, no one would have believed they were.
North Korea has survived as an independent state for a lot longer than East Germany did.
East Germany was an independent state for months in 1990. It nominally had its own government before 1990, but in reality, the Soviets would not have allowed an anti-Soviet candidate to be elected. Because the Soviets would have expected exactly what happened in 1990.
The Soviet Union left North Korea in 1948. So in 1990, when East Germany briefly became an independent country, North Korea had been independent for forty-two years.
Even if we count East Germany as an independent country from 1949, when the government formed, that's still a year later than North Korea. And I reject any definition of independent that allows for involuntary occupation by the troops of a foreign nation.
North Korea has not wanted to give up its current government to reunify with South Korea. This may not be a decision of the North Korean populace. North Korea is effectively a dictatorship. It's a one party state where the dictator controls the one party and therefore the winners of any elections it may hold. The dictatorship has been passed by inheritance only. So to say that the country does not want to give up its government is to say that the effective monarch of North Korea doesn't want to stop being the effective monarch.
East Germany was also a one party state. But it was never controlled by a single family that passed control of the party through inheritance. And there is no indication that it ever desired to be an independent country. After the post-Communist government took office, it lasted less than six months before reunification.