Twenty-five years ago, four big things happened that still shape our world. The Berlin Wall came down, and with it the empire that Vladimir Putin would love to restore. The Tiananmen Square massacre launched China on a completely different trajectory, which has made it what it is today. A then little-known British boffin called Tim Berners-Lee invented what would become the world wide web. And Ayatollah Khomeini delivered his fatwa on Salman Rushdie.

Last Sunday I sat down with Rushdie in New York, at the American PEN World Voices festival, to discuss the consequences of those events for freedom of expression around the world. I asked him how he had experienced the velvet revolutions of 1989 and where he had been when the wall came down. He could not exactly remember – some safe house presumably – and he confessed to having felt a tinge of envy at watching others, including Nelson Mandela a few years later, walking to freedom while he was still in durance vile.

There is no hint of that now. After the day's events, we wandered out on to the streets of New York, with a gaggle of other writers, and Salman stood on the corner of Cooper Square hailing a cab. Who knows where the taxi driver came from. Iran, perhaps? This normality of one writer's life, which for so long seemed an unattainable dream, is a victory. The larger question is whether the struggle for free speech against fanatics and oppressors of all kinds is moving in the right or wrong direction.

In Britain, and in Europe more generally, a majority of Muslims have, one way or another, clearly accepted the basic rules of peaceful coexistence in a liberal pluralist society. They no longer say, as a British Muslim called Iqbal Sacranie did in 1989, while some of his co-religionists were burning copies of The Satanic Verses, that death might be "a bit too easy" for Rushdie. One small symptom of this improvement was the mildness of most British Muslim reactions to the 2007 award of a knighthood to the novelist. (Rushdie recalls that the Queen, after tapping him on the shoulder with the sword of honour, asked: "Are you still writing books?") But then Her Majesty – or rather, Tony Blair through her – had also knighted that same Sacranie two years earlier. A very British solution: give 'em both a knighthood.

The serious point stands: in Britain, as in many other European countries, the overall evolution among the great majority of Muslims has been towards an acceptance of, and even an active support for, freedom of expression, which necessarily includes the right (though not a duty) to offend.

On the other hand, Rushdie argued – and some careful research supports this view – that a small minority in these European Muslim communities is still being dangerously radicalised. And self-censorship out of fear keeps gnawing away at the edges of western cultural life, whether in universities, publishing or theatre. The satirical musical The Book of Mormon continues to delight audiences in New York and London. No one seems to be planning a sequel called The Book of Muhammad.

In many majority Muslim states, the constraints on freedom of expression remain horrendous. Saudi Arabia has issued new laws this year that treat atheists as being on a par with terrorists. On the day of our event, the New York Times carried a report about Alexander Aan, who served more than 19 months in prison in Indonesia on a charge of inciting religious hatred. His crime? Simply declaring himself online to be an atheist. As worrying: previously more secular swing states such as Turkey have been moving the wrong way.

MF Husain, arguably the country's greatest modern painter, died in exile after fierce attacks on his irreverent, modernist depictions of Hindu deities. The situation seems likely to get worse if Narendra Modi wins the current election. Meanwhile, across the border in Burma it is people who call themselves Buddhists who have been lynching Muslim Rohingya.

In China, the post-1989 system has produced both what will soon be the largest economy in the world and what is already the largest censorship apparatus in the world. But whereas elsewhere religious power-holders persecute atheists and people of other faiths, here, the Communist party-state goes after anyone who tries to organise along religious lines without its approval, be they Christians or Falun Gong. (Privatised spirituality is fine, and sought by many party apparatchiks.)

One reason the Chinese censorship apparatus is so vast is that there is simply much more "speech" to be monitored than there was 25 years ago, because of the internet. WeChat, the Chinese equivalent of WhatsApp, has well over 300 million users. The winner of this year's American PEN digital freedom award, Twitter's CEO Dick Costolo, reminded us that it hosts more than 500m tweets a day. This is a huge quantitative gain for free speech, but it brings its own dangers. It is not just authoritarian regimes that abuse the internet as a tool for mass surveillance.

A PEN survey of American writers found them not only worried about the NSA surveillance revealed by Edward Snowden but also, in some cases, feeling the need to self-censor as a result. In other words, it has had a chilling effect.

"As to the battle over The Satanic Verses," Rushdie wrote in his memoir Joseph Anton, published in 2012, "it was still hard to say if it was ending in victory or defeat." The same may be said of the consequences of those four giant events of 1989. But that is the way with the battle for free speech – never entirely lost, never conclusively won.