Here, in order of cheapness/freeness, are a few suggestions:
1: Go through and clean every electrical connection you can find under the hood. If you can't physically clean them with a wire brush or spraying electrical cleaner, make-unmake the connections several times to 'freshen' them up. These cars are very sensitive to good electrical connections and many of those get diry/corroded and build up resistance over the years. And I'm talking EVERY connection - injectors, sensors, battery terminals and even grounds.
2. When the car starts running roughly, pull off either the spark plugs or the injector connectors one at a time (injectors are easier and won't shock you). What should happen is the car will run worse when you do this. If there is NO change for one or more cylinders, those ones aren't firing or getting fuel for some reason.
3. Do a vacuum test. These cars are also very sensitive to having a tight vacuum system. This test works best if you have a vacuum gauge, but you can also pull off one vacuum line at a time and see if there is any difference in the way the car runs, which may lead you to the problem. YOu can also spray carb cleaner or WD40 or starter fluid or something similar around sensors and manifolds. It the rough running suddenly smooths out when you do this in a certain area, it could mean you have a leaky gasket or seal. The air going into a Z engine is metered and any extra leaking in will make it run bad. FWIW, I have found it to be common on the Zs I've bought to have a bad intake manifold gasket. They're a pain to swap out, but if all else fails, you might consider trying that.
4. Pull off the fuel inlet line under the hood, put one end in a jar or bucket. Remove the small wire going to the starter (so the car won't try to start). Have someone turn the key as if starting. See if fuel pumps out INTO THE JAR OR CONTAINER, NOT ON THE GROUND. No need to measure it at this point, just see if it flows out in a nice strong stream. Then put it back together. Obviously, be VERY CAREFUL around raw fuel.
5. Make 100% sure your battery is good and putting out max volts. If in doubt, grab a new one. Also, corroded battery terminals/wires can sap a lot of power. If yours look bad, replace with aftermaket ones.
6. Check the timing and make sure your vacuum advance is working. Requires timing light.
7. Is your fuel fresh? If you're trying to bring the car back after sitting a long time, the fuel could have spoiled. Drain it and put new gas in.
8. Compression test. This will require borrowing or buying a compression gauge.
9. Buy a factory service manual, digital or the actual paper-and-ink book. They are mandatory for anyone doing their own work on these cars.
Bottom line - the early Zs and their simple fuel injection systems (compared to today's cars) are easy to understand if you take the time. The engines are bulletproof and problems like yours are hardly ever mechanical in nature. Most problems I've come across in 25+ years owning these cars are electrical or vacuum related.
Good luck and let us know what you find!