Your question, "If nuclear weapons are the only way of diverting an incoming asteroid, is it worth keeping them in existence for the purpose, or would it be safer on balance to disarm and risk the impact?" shows a failure to appreciate the full implications - which are in fact evolutionary.
First some facts; impacts capable of exterminating the human species have occurred and will do so again.
Nuclear weapons in fact risk splitting one impactor into a few fragments, merely multiplying the threat; for long-period comets we can receive as little as two to three-month lead times - for example, Comet Hyakutake, whose impact, had it occurred, would have destroyed most large lifeforms on Earth, including us.
Your comment therefore amounts to no more than a suicide note, and simply "risking an impact" is unworthy of a mindful species.
But there are alternatives to nuclear weapons. These include mirror-reflected energy or mining operations carried out on Near Earth Objects in the service of space industry.
Michael Martin-Smith President, Space Age Associates