Yup, distributor with electronic module is a common thing with the TBI vehicles. Last week I amazed a good friend by resurrecting his v6 Silverado. Same random behavior as yours. His wasn't as far gone as yours, it would usually start up good in the morning. Once it warmed up a bit, no bueno.
I took a look under the hood and immediately saw a shiny aluminum distributor. Checked the timing: good in disabled mode at zero, all over the place in electronic control mode. I went home, grabbed the distributor out of the S10, and brought it to his truck. Pulled his cap, noted the rotor position, and swapped my 30 year old dirty Delco distributor. Put his cap back on my old guts, turned the key, and set zero in disabled mode.
He took his shiny durodone distributor back to advance zone and got a spare, in case my old OEM ever dies. After he tried to give me a hug and a kiss.