Do you feel that it is misfiring, or you only see the codes?
A misfire can occur due to no spark, but also due to a not good mixture in a cylinder. If it runs rough, then it is really misfiring. You could have a sticking valve or a rocker which has fallen of. Sticking valves can happen due to carbon buildup on the valve stems. Try a seafoam treadment through the brake booster vacuum line. If that doesn´t help, then i would remove the cylinder head cover and check if the rockers are in place.
Did your engine overheat in the past?