The Intake stroke produces energy as it increases the potential energy of the system, assuming that the system is the engine.
The Compression stroke is an idle stroke if you disregard the energy needed for it to happen.
The Power stroke could be said to be an idle stroke as the amount of energy in the system not changing (I think, cuz the potential energy is just being transformed into heat energy (If that is possible))
And the Exhaust stroke should release the heat energy made in the previous stroke from the system.
I would say it is exactly the reverse.
Intake and exhaust are just moving the gas, so they are mostly idle, compression requires a lot of energy to squeeze the gas (piston does the work on the gas), power stroke is where the energy is being produced and combustion products do the work on the piston.
But when you are using the engine to slow down the car you are not supplying the fuel, so the power stroke doesn't exist.
Ideal engine, with ideal gear mechanism, would just compress the gas and then the compressed gas would do work on the piston, so that the energy balance would be zero - as much as was put in would be put out. But the engine is not ideal, and it gets hot in the process, both because of friction and because the compression and decompression are not entirely adiabatic. And yes, you are right in the end it is the heat energy.