Tony Blair has warned the Labour leadership against using the union as a bargaining chip and accused Boris Johnson of putting the future of the UK at risk over Brexit.

During a visit to Edinburgh, the former prime minister said it would be a “big mistake” for Jeremy Corbyn to enter into “horse-trading about the union”, when he was asked if the Labour leader should grant a section 30 order – which gives the Scottish National party the necessary legal powers to hold a second independence referendum – in order to secure their support at Westminster in the event of another hung parliament.

Speaking to the Scottish Parliamentary Journalists’ Association on Tuesday, Blair described such a move as “a major category error, both in principle and politically”, saying: “I don’t think that Labour should give any indication at all that it’s prepared to put the union on the table as some form of bargaining chip.”

The former Labour leader added: “Is Boris Johnson putting the union at risk because of Brexit? Yes, of course it does put the union at risk, it puts Northern Ireland at risk, it puts Scotland at risk.” Blair wrote in Sunday’s Observer that Johnson’s Brexit strategy risked undermining the peace in Northern Ireland that he had helped to broker.

Citing Labour’s 2015 election campaign, when the Tories used the possibility of a pact with the SNP to undermine Ed Miliband, Blair said: “The question of whether there is another independence referendum has to be decided completely separately from questions of who forms the government of the UK.”

Blair repeated warnings that a general election focusing on Brexit was an “elephant trap”, insisting a referendum was the only way to resolve the issue. “Otherwise there is a substantial risk that we end up with a no-deal Brexit, not because the country wants it, but because the opposition vote is divided,” he said. “The Conservatives can claim a mandate in a general election for something that I doubt very much would ever pass a referendum specifically on it.”

Blair cautioned that “in the world of real, retail politics” Labour would have 20 seconds to explain its Brexit policy to voters on the doorstep but suggested it was likely to take activists “a good half an hour” at present.

Asked whether he intended to vote Labour at the next general election, he said he was “not intending to vote anything else”. He said: “It’s a struggle, I’ll be honest with you because I worry a lot about the direction of the Labour party. I’ve found the debate and controversy over antisemitism distressing, extremely distressing. And I think there is a sectarianism that’s been brought into the Labour party that’s damaging.”

Blair suggested that the former Scottish Tory leader Ruth Davidson’s departure from frontline politics offered a “huge opportunity” for the Scottish Labour party, which is languishing behind the Conservatives and the Liberal Democrats in polling.

“My belief is that it will be clear over these next months that there is potential for renewal of the centre ground of politics,” he said. “I think that’s true in the UK as a whole, I think it’s true in Scotland, as well. With the departure from the scene of Ruth Davidson, from politics in Scotland, there is a very open space for the competition for that centre ground vote.”