If Nancy Pelosi visits Taiwan, China should arm Russia with HJ-12 missiles and bring the pain to American proxies in eastern Ukraine. This will teach Americans what it means to mess with China.
Idk if it would work as well as you think.
The HJ-12 is indeed probably the best anti tank weapon in the world in its weight class, but Ukraine doesn't have enough tanks that they're posing much of an armored threat to Russia.
I'd rule out an US military backed visit, because China will for sure declare a no fly zone and ban US travel to Taiwan then. And realistically, US is not in a position to fight with an economy like that and Ukraine draining their supplies.
I'd not completely rule out Pelosi visiting under civilian identity using a commercial plane, after some sort of deal is worked out. If that happens, China could explore providing support to Russia so as to greatly hasten Russian victory. Sale of air assets, access to China's satellite targeting network, sale of extreme range MLRS such as Phl16, etc.