If you do change to a newer style engine, I'd suggest 360 to better match torque and power of the previous engine. With the same prop and gearing, it should run a little easier vs the 340. A 318 would have to run hard unless you reduce prop pitch.

Excess load from too much pitch can contribute to detonation. With full throttle the engine should max out around 4300-4500 RPM. Less than that means too much pitch, more means not enough.