Cause of Burned / Fried Q31 Transistor in OBD1 ECU's
The Q31 transistor is in the purge control solenoid circuit in the ECU. This transistor fries/burns when the purge control solenoid connector on the engine harness is mistakenly plugged into the intake air temperature sensor instead of the purge control solenoid. The purge control solenoid is a basic on/off solenoid. The wire harness provides +12v to one wire at the connector, and the ECU will ground the other wire through the ECU when it wants to turn the purge control solenoid on. The intake air temperature sensor is a thermo resistor. When the purge control solenoid plug on the engine harness is mistakenly plugged into the intake air temperature sensor, it routes the +12v power through the intake air temp sensor and directly back to the ECU which fries/burns the Q31 transistor. You will also find that this burns/damages the intake air temperature sensor in the process, and can be seen by the brown/black discoloration on the end of the intake air temperature sensor if you pull it from the engine.
Good news is that the ECU can still be used as-is if you doesn't want the hassle/expense of repairing it. Simply correct the wiring issue and replace the intake air temp sensor. The ECU will now just not run the purge control solenoid, which is only used for emissions so it will not affect engine operation.