Alan, I just don't know what engine You have, but I it is a stovebolt, You can take the timing gear out of the cam with the cam in place, it's hard to do but it is possible. But You'll not drive the new one without taking it out of the engine.
You'll need a press to drive it to his place. If You just try to hammer it to the cam, it will make the cam expell the cam plug in the block rear side and an oil leak will occur. Also You can break something in the process. If it is already disassembled, take some time to remove it from the engine, and change it out. And You'll have to pull the grill out to make it happen.
But I don't think the trouble is there. Check the exaust valves, check the base ignition timing, plugs, wire plugs. Seems to me You're been through a ignition or valve stuff. Not valve timing.