This plan has some merit but faces significant challenges.
The cooling mechanisms would work to some degree. Venting atmosphere would indeed remove heat through two processes: the departing gas carries away thermal energy, and the remaining gas cools through adiabatic expansion as pressure drops. However, the cooling effect might be less dramatic than the crew hopes. In the vacuum of space, they're losing their primary method of heat rejection - convection. The ship would then rely solely on radiation for cooling, which is much slower.
The atmosphere restoration presents bigger problems. While it's theoretically possible to generate nitrogen and oxygen from solid compounds, the chemistry is tricky:
For oxygen, they might decompose perchlorates or superoxides, which spacecraft sometimes carry for emergency oxygen. But these reactions are typically exothermic - they'd generate more heat, partially defeating the cooling purpose.
Nitrogen is harder. Most nitrogen-containing solids that could release N₂ gas require high temperatures or would produce toxic byproducts. Ammonium nitrite decomposes to N₂ and water at moderate temperatures, but it's unstable. Azides could work but are explosively dangerous.
The crew would need to carefully calculate whether they have enough solid reactants to fully restore cabin pressure. They'd also need scrubbers ready for any toxic byproducts, and precise control over the reaction rates to avoid pressure spikes.
A partial venting might be safer - reducing pressure enough to get some cooling benefit while preserving enough atmosphere to maintain convective heat transfer inside the ship. This would also reduce the amount of gas they need to regenerate.