Have you checked the condition of the distributor cap and any dust on the optical sensor?? Have you checked the injector on #5?. Try switching #5 plug and wire with a different one to see if miss follows the plug or not. I believe the best plug to use is the NGK brand, bosch seem to create problems on some engines. Probably try another injector cleaner like Chevron or B12.
DO NOT worry about the knock sensor code as that is from the vibration of the miss. Replacing knock sensor would be a wasdte of money.
How long since you used the SEAFOAM??