Was Japan wise in agreeing to initiate trade with external powers?
It is hard to say if it was "wise" for Japan to open itself up to trade, as the Japanese had no choice in the matter. They were forced to open themselves up to trade with the West. To the extent that Japan became a westernized country, its opening may have been beneficial; but even this assumes that there was something innately "backward" about Japan's ancient culture.
Japan had previously engaged in self-imposed isolation. They openly discouraged Western nations from trading because they believed they had nothing to gain. Those who dared attempt trade were crucified. Commodore Perry forced the Japanese to open trade with the U.S. by training his guns on Tokyo, and threatening to destroy the city. Since most Japanese buildings at the time were made of paper, it would have been easy for Perry to carry out his threat. As in most cases of Western penetration into Asia, Americans and Europeans had little to offer Asians which they wanted or needed; quite the contrary was true. Perry's action in forcing the Japanese to accept trade was not for their benefit, in which he had no interest; it was solely for the benefit of U.S. merchants. That being the case, the question of whether it was "wise" for Japan to open itself to Western commerce is academic. The Japanese were not given a choice in the matter.
Japan was absolutely wise to open up to external trade after the visit of the American ships led by Commodore Perry in 1853. There are at least two reasons for this.
First, Japan needed to open up if it was ever to become a modern country. Without Western knowledge, Japan would not have been able to industrialize and to modernize its society. If we believe that modern, industrial society is a good thing, Japan was right to open.
Second, Japan was helpless to resist the West and might have been seriously harmed if it refused to open. If Western countries had wanted to, they could have used their superior technology (and the fact that Japan's population is centered on coasts) to destroy much of Japan.
For these reasons, Japan was wise to open up to external trade.