Japan was not in stasis in the 1850s. Its society was changing by itself: you had the quiet transition from a rice-based to a monetary economy, the emergence of a class controlling much of the wealth but excluded from political influence, lots of unemployed samurai kicking about, ambitious peripheral lords who had been more succesful in making their domains efficient and profitable than the central government, and all sorts of intellectual ferment as modern Japanese nationalism started to crystallise.
In short, the reason that Japan was able to rapidly bring itself on a level with industrial Europe was in large part because it was already on a level with immediately pre-industrial Europe. The Japanese achievement was not in going from middle ages to 1860s, but 1790s to 1860s; isolation was what had allowed Japan to get to its 1790s in the first place, whereas China, of course, had already been the victim of commercial imperialism by the 1850s.
Whatever the response to Perry, Japan was still going to change, and soon. It's an interesting scenario to explore, but it isn't continuing isolation.
China modernising is another interesting scenario. Do bare in mind that China was trying to modernise itself continuously after the Opium Wars, but besides lacking Japan's various advantages, they had consistently shit luck.
To shamelessly rip off Ed Thomas, again, merely interfering with the Sino-Japanese War of 1894-5 a bit can be of massive help: if China suffers a less severe defeat, the Japanese and thus Russians don't eye Liaodong greedily. The rush for concessions in north China is averted, the disastrous Boxer rebellion butterflies away, and one puts imperial China on a course to maintain some of its independence and continue gradual modernisation efforts.
This is too late for China Takes Over Everything, but (especially with the help of a European patron), China could recover its status as a respected great power in time.