If the chimney is down for good, then fire MUST be disconnected and the pipe capped.
Strict letter of the law states that any work done on a gas pipe MUST be done by a suitably qualified gas fitter, a plumber without gas qualifications is not allowed to do this job.
I have known many cases of someone shutting off the main gas valve, removing the valve at the fireplace, and tightly fitting a 1/2" mild steel (NOT galvanised) cap using PTFE thread on the pipe thread.
then turning the main gas back on and testing all visible joints at that area for leaks with a solution of washing up liquid and water, Any sign of a bubble in the liquid shows a leak.
But you should get a qualified person to do all that for you.