In general, isolationism is not a good idea. The more you separate yourself from the rest of the world, the easier it is to fall behind technologically and economically. Isolation denies you the enormous benefits of trade and cultural sharing, and while it seems to protect you from attack for...
In general, isolationism is not a good idea. The more you separate yourself from the rest of the world, the easier it is to fall behind technologically and economically. Isolation denies you the enormous benefits of trade and cultural sharing, and while it seems to protect you from attack for awhile eventually it can put you in even more danger as other nations overtake you technologically and don't have the interdependence of culture and trade to deter them from attacking you.
For example, while France has a strong military and a substantial nuclear arsenal, these are not the reason the US does not invade France. The US and France both share so much culture and trade that it would be a clear loss to both of them to engage in hostilities, regardless of the outcome of the war; more than that, we even think of each other as friends and would never want the other to come to harm. Indeed, this is now largely the relationship between the US and Japan---but it certainly wasn't during the Edo Period. (The US was actually founded in the middle of the Edo Period; but due to Japan's isolationism, they hardly seemed to notice.)
That said, if anyone could get away with isolationism, it would be Japan. (The second would be the United States, and we also went through some significant periods of isolationism, albeit nowhere near as long as Japan did.) The geography of the islands of Japan makes the entire country essentially a natural fortress, which was basically impervious to attack until the invention of airplanes. Their isolation from other countries combined with their high level of national security has given Japan the opportunity to develop one of the world's most distinctive cultures, largely free of external influences for centuries.
A major motivation for the isolation of the Edo Period was the exclusion of other religions, particularly Christianity. This was largely successful; to this day most people in Japan maintain beliefs in Shinto or Buddhism even as the rest of the world has become increasingly converted to Christianity. So there were upsides to the isolation, but in general I think the downsides of being excluded from world trade outweigh the upsides.
In the end, Japan's hand was forced by some quite literal gunboat diplomacy, as in 1853 the United States brought battleships to Japan's shores and demanded that they reopen trade. While they were no doubt unhappy about this, in the long run Japan has benefited greatly from being industrialized and reintegrated into global trade, so much so that they are now essentially a First World country.