Recently I had a similar problem with my 97 3.0 Vulcan, however mine was a misfire on cylinder 4. Like yours, the check engine light would occasionally flash while sitting at a stop light.
My misfire problem was resolved after I replaced the (squeaky) original camshaft synchronizer with a remanufactured motorcraft unit w/sensor from Rock Auto.
Changing the camshaft position sensor will not resolve problem. I know this because shortly after I purchased the car back in Oct 2012, the original sensor failed (magnet fell apart) giving a trouble code and it was replaced with a new sensor from Oreilly's.
The camshaft synchronizer was not squeaking or causing misfiring during this time so the complete unit was not changed. Thinking back I should have just changed out the complete unit as preventive maintenance.
Later as routine maintenance, I replaced the coil pack, UIM
valve, throttle position sensor, plug wires & plugs with new parts so I knew that these parts were not suspect. Switching out a fuel injector from another cylinder did not help either. It was always cylinder 4 misfiring.
The camshaft synchronizer is very easy to replace when using the plastic alignment cap that autozone provides through the loan a tool program. Just don't tell them that you purchased the part at Rock Auto for 50% less than AZ! LOL!
Next I am replacing the 02 sensors after getting a P0133 code. They are due to arrive on Thursday from Rock Auto and will be installed Friday or Saturday. Then after the sensor replacement, I am going to rebuild the fuel injectors with new screens, etc from a rebuild kit I purchased on Ebay.
I really enjoy working on this old car.