In late 2011 Martin McGuinness stood as Sinn Fein’s candidate in Ireland’s presidential election, raising all sorts of intriguing possibilities.

Raised in a tiny terraced house in the Bogside, Derry, he would have ended up living in a 92-room presidential mansion in Dublin had he won. A former IRA commander, he would have become supreme commander of Ireland’s defence forces. Once banned from Britain under the Prevention of Terrorism Acts, he would have received the credentials of the next British ambassador to Dublin. Were he invited to pay a state visit to London, a man who had spent much of his youth shooting or bombing British soldiers would have found himself inspecting a guard of honour at Buckingham Palace.

McGuinness would certainly have shaken the hands of the English team before the Ireland-England rugby match at the Aviva Stadium in Dublin every other year. “I’d have no problem with that,” he told me, grinning, as he campaigned in the border county of Cavan one day that autumn. Though a staunch republican, he enjoyed the “Protestant” sports of rugby and cricket, just as he supported Manchester United and enjoyed BBC nature programmes and Last of the Summer Wine. He wrote poetry and loved fly-fishing, too. Unlike Gerry Adams, the coldest of cold fish, McGuinness was hard to dislike – provided you overlooked his brutal past.

In the event, McGuinness, weighed down by IRA baggage, came a distant third in that election but his story was astonishing enough in any case. He was the 15-year-old butcher’s assistant who rose to become the IRA chief of staff, responsible for numerous atrocities including Lord Mountbatten’s assassination and the Warrenpoint slaughter of 18 British soldiers in 1979.

Then, in 1981, an IRA prisoner named Bobby Sands won a parliamentary by-election while starving himself to death in the Maze Prison. McGuinness and Adams saw the mileage in pursuing a united Ireland via the ballot box as well as the bullet. Their long and tortuous conversion to democratic politics led to the Good Friday accord of 1998, with McGuinness using his stature and “street cred” to keep the provisional’s hard men on board. He became Northern Ireland’s improbable new education minister, and later served as its deputy first minister for a decade.

His journey from paramilitary pariah to peacemaker was punctuated by any number of astounding tableaux – visits to Downing Street and Chequers; the forging of a relationship with Ian Paisley, his erstwhile arch-enemy, so strong that they were dubbed the “Chuckle Brothers”; his denunciation of dissident republican militants as “traitors to the island of Ireland”; talks at the White House with Presidents Clinton, George W Bush and Obama; and, most remarkable of all, two meetings with the Queen as well as a state banquet at Windsor Castle at which he joined in the toast to the British head of state.

Following his death on 21 March, McGuinness received tributes from London that would have been unthinkable 20 years ago. Tony Blair said peace would not have happened “without Martin’s leadership, courage and quiet insistence that the past should not define the future”. Theresa May praised his “essential and historic contribution to the extraordinary journey of Northern Ireland from conflict to peace”.

What few noted was that McGuinness died with his ultimate goal of a united Ireland arguably closer to realisation – albeit by peaceful methods – than at any other time since the island’s partition in 1921.

The Brexit vote last June has changed political dynamics in Northern Ireland. The province voted by 56 per cent to 44 in favour of remaining in the European Union, and may suffer badly when Britain leaves. It fears the return of a “hard border” with the Republic of Ireland, and could lose £330m in EU subsidies.

Dismay at the Brexit vote helped to boost Sinn Fein’s performance in this month’s Stormont Assembly elections. The party came within 1,200 votes of overtaking the Democratic Unionist Party, which not only campaigned for Leave but used a legal loophole to funnel £425,000 in undeclared funds to the broader UK campaign. For the first time in Northern Ireland’s history, the combined unionist parties no longer have an overall majority. “The notion of a perpetual unionist majority has been demolished,” Gerry Adams declared.

Other factors are also working in Sinn Fein’s favour. The party is refusing to enter a new power-sharing agreement at Stormont unless the DUP agrees to terms more favourable to the Irish nationalists. Sinn Fein will win if the DUP agrees to this, but it will also win if there is no deal – and London further inflames nationalist sentiment by imposing direct rule.

McGuinness’s recent replacement as Sinn Fein’s leader in Northern Ireland by Michelle O’Neill, a personable, socially progressive 40-year-old unsullied by the Troubles, marks another significant step in the party’s move towards respectability. As Patrick Maguire recently wrote in the New Statesman, “the age of the IRA old boys at the top is over”.

More broadly, Scottish independence would make the notion of Northern Ireland leaving the UK seem less radical. The Irish republic’s economic recovery and the decline of the Roman Catholic Church have rendered the idea of Irish unity a little less anathema to moderate unionists. And all the time, the province’s Protestant majority is shrinking: just 48 per cent of the population identified itself as Protestant in the 2011 census and 45 per cent Catholic.

The Good Friday Agreement provides for a referendum if a majority appears to favour Irish unity. Sinn Fein is beginning to agitate for exactly that. When Adams and McGuinness turned from violence to constitutional politics back in the 1980s they opted for the long game. Unfortunately for McGuinness, it proved too long for him to see Irish nationalism victorious, but it is no longer inconceivable that his four grown-up children might.