What does it take to get a new law before parliament on something that is complicated, disputed and running into a lack of political will?

Three years ago, following a series of revelations that libel threats had silenced scientists, doctors, biographers, community lawyers, consumer groups and human rights activists, Jack Straw, the then justice secretary, promised to reform the libel law.

Finally, in 2013, parliament is set to produce a new defamation act and give greater protection to free speech and the public interest. Getting a good, fair law that solves those injustices has taken months – years – of consultation, scrutiny and argument.

Which is why it is so infuriating to see the political game surrounding Leveson this week, and how it has brought the defamation bill limping to the final stage of its passage through the Lords dragging a last-minute "Leveson clause" shackled to its ankles. The clause is a political tactic to get a press regulation bill. It was put down at the last minute by Lord Puttnam and pushed to a vote by the opposition benches. Yes it was "by the back door", they retorted to critics, because they were frustrated about getting a Leveson bill by the front door. So press regulation has hijacked the nearest passing parliamentary vehicle. The government is unlikely to accept this, which means the defamation bill is now under threat of being dropped. This is a gamble the amendment's movers were prepared to take.

The provisions in the defamation bill would roll back centuries of unfair and chillingly expensive libel law, much of which derives from a time when gentlemen were being encouraged to pursue their costly reputations in the courts rather than with pistols. We would see an end to the "multiple publication rule" which in the age of online publishing has led to the ludicrous situation where every download of an article can be counted as a new publication. The new law would inhibit libel tourism, where wealthy oligarchs and autocrats have used punitive judgments in our courts to silence critical writers in their own countries.

Of vital importance, it would bring in a public interest defence. Everybody, defendants and claimants, would be in a much clearer position about their rights and protections, and this means disputes could be resolved more quickly and cheaply. It is likely to reduce the number of trivial and vexatious claims that are used as a way of tying up critics by people who pay law firms for "reputation management strategies". There is still work going on to improve provisions on internet publishing, particularly the phenomenon of automatic take-downs by web hosts, and to ensure that the public interest defence will survive the battering of the courts. A welcome restriction on corporations being able to sue individuals, proposed three years ago, was added to the bill on Tuesday. We are close to really good change.

That is not surprising. The defamation bill has been through three public consultations, two working groups and seven parliamentary debates. It has been informed by scientists, doctors, authors, human rights groups, community forums and hundreds of others who have been threatened or who won't speak up about public interest matters for fear of losing their house in a legal action. Lord Lester spent months consulting leading counsel and others as he drafted the private member's bill that began parliament's consideration of reforms. The Libel Reform Campaign, with meagre resources but the support of thousands, has engaged hundreds of organisations, politicians and lawyers. It has been a uniquely crowdsourced law, involving Citizens Advice, scientific societies, Mumsnet, Global Witness and others, as much as libel QCs and law lords.

The law on press regulation after the Leveson report, on the other hand, is still highly contested. Lord Leveson reported in November. The hastily drafted amendment stunt last Tuesday shows that no one has had much time to think about how the legal options look in practice. It was sprung on a Friday afternoon and pushed to a vote the following Tuesday. So much for pre-legislative scrutiny.

This political stunt is now risking the future of the defamation bill. It sets up the possibility that the government could ditch the whole bill in order to ditch the Leveson clause. There are already murmurings about this coming from government sources.

Labour, Liberal Democrats and Conservatives all went into the last election with libel reform in their manifestos. That is a promise they must now make good. The defamation bill had been set to come back before the Lords for its third reading later this month before heading back to the Commons. For every month that it is delayed, we add another month like this one, when a doctor won't write about a dangerous treatment, a book about scientology is published all over the world but not here, and researchers in a London university receive a threat of legal action for criticising a misleading product.

Libel cases are so often described as a game of high-stakes poker, where you rack up years of costs on an unpredictable outcome. Thousands of writers, scientists, politicians have fought hard to create this historic opportunity to bring an urgently needed end to the dangerous libel chill we impose on the world. It is a rare victory for citizen activism and parliamentary deliberation. A good law could now replace a bad one. We can't afford to shackle it to months of debate about another area of law and lose it in a political game.