IT’S all an appalling mess, but it does offer the recompense of bringing Scottish independence that bit nearer. This contention might have been hard to credit during last week’s Brexit turmoil, especially after Scotland merited not a single mention in the 585 pages of the UK Government’s draft agreement for withdrawal from the EU. As a codicil came the visit to Edinburgh by Theresa May’s second-in-command, David Lidington. Amid an exercise in contemptuous discourtesy to the government of Scotland he called on it, for good measure, to forget a second independence referendum. Think of it as a woof and snap from the fawning lapdog of his mistress.

I’m sure we always knew the UK Government would continue rejecting a second referendum. May has normally defined the vote in 2014 as conclusive, and ignored Nicola Sturgeon’s argument that circumstances have so changed as to justify another.

READ MORE: SNP to call for indyref2 if May's Brexit deal makes it through the Commons

Yet May has failed to make her Scottish problem go away, however trifling it may seem to her. Her claim that our interests would be fully taken into account in the Brexit negotiations is visibly a sham. That was always the case in the matter of immigration. When Scotland’s need for foreign labour to boost its ageing workforce was set against the hatred in parts of England for Polish plumbers and Bulgarian barmen, there could be no doubt which would weigh more heavily in the Prime Minister’s mind.

Nor has she lost the taste she acquired as Home Secretary for cruel persecution of inoffensive strangers on the grounds of their breaching of some obscure regulation, or a change in it known only to her officials. When a second of her lapdogs, David Mundell, was challenged to give a single specific instance of Scotland’s interests being taken into account, he had no answer.

READ MORE: The People's Vote campaign's supporters prove it's not about the people

Now May faces a threat to the integrity of the United Kingdom more formidable than any Scotland by itself has been able to pose since Brexit began. But it is one of her own making, and it rests on the backstop she has consented to if further negotiations fail to produce some better answer to the problem of the Irish border by the end of 2020. To fend off any more bombs and bullets, Northern Ireland would then remain within the single market and customs union forever, or at least till the EU agrees to let it go.

While the rest of the UK might in theory be free to follow its own path, in practice it would for the sake of Ulster need to accept whatever further regulation was thrown its way from Brussels, without having a vote there. Otherwise, for the smallest territory of the UK, the bonds of the Union would visibly unravel.

I may be wrong, but I would have thought even somebody as blinkered as May could hardly have supposed this bright idea might pass without notice in the closest part of the island of Great Britain. Scotland is in much sounder economic shape than its neighbour across the North Channel, but both are in the market for footloose international investment. This often looks in particular for a base in Europe where chains of long-distance, just-in-time supply can operate without any kind of hindrance. Which American or Chinese companies are going to prefer Scotland to Ulster if in Scotland they face regulatory quirks and brittle supply chains, while Ulster retains to all intents and purposes free trade with the rest of the EU?

READ MORE: David Mundell unable to say if Brexit deal will be good for Scotland

Whether a spade be called a spade or not, we would then have a commercial border in the North Channel and down the Irish Sea. Where should we carry out the necessary checks and controls on the traffic across it, touchy in terms of politics and risky in terms of security? Surely Cairnyan or the Clydeport harbours would be safer and handier than Larne or Coleraine. So the checks and controls could end up on this side of the water, because nobody here wants to blow up border posts or people manning them.

Then it could make little logistical difference to shift the customs and controls onwards another 80 miles down the road to Gretna/Carlisle. With counterparts at Berwick, Scotland could stay in the single market too. It’s true this idea has always been ridiculed by Unionists. But I’m not sure, after the way we are being treated from London, that on this point Scottish sensibilities are any longer quite so delicate.

Brexit has usefully opened our eyes in many ways and, if we look, we will see this concept of a diffuse border, rather than a single thick line on the map, mirrors what already happens in EFTA countries. They have political borders different from economic borders. By the same token Scotland, while still part of the UK politically, could belong economically to the EU single market and customs union too. If the physical consequences of this distinction (halts, inspections, bureaucracy) were deemed acceptable at Larne or Cairnryan, it’s hard to see how they could become unacceptable at Gretna/Carlisle.

The Debatable Land offers loads of room for lorry parks. Isn’t this just the kind of thing the Prime Minister likes to call a bespoke deal?

There is also more advantage than disadvantage in the fact this could only be for goods in transit, not for passengers who would as usual pass through the border by road or rail. The arrangement might of course blow open the revised controls on immigration that May promises, in place of those she first imposed from the Home Office in 2010 – which have been a consistent failure, by a mile, in every single year of their operation since. The people of an open, trading economy perhaps still need to be shown they will do more harm than good to it through crackdowns on migrants. We could show the way at Gretna/Carlisle.

So altogether I agreed with the two ministers who walked out of the UK Government a week ago, Dominic Raab and Esther McVey, when they said in their letters of resignation that Brexit as it stands is a threat to the Union. This is not only for their reasons, based on the prospective deal to come in a final settlement, but also because it opens our minds to possibilities that have been ignored or downplayed in the past, like the scenario I have just described.

As pointed out by our Brexit secretary, Mike Russell, the two ministers’ preference for a harder Brexit than May proposes, even at the risk of no deal, is likely to pose an even greater threat to the Union because Scots may find the problems of independence on balance a more palatable option.

By international standards we have been lucky in Scotland to move towards independence without terror, without murders, without civil war and a legacy of bitterness for future generations. Unionists claim the referendum campaign of 2014 was a negative, divisive experience, but throwing a few eggs at your opponents hardly compares with shooting them. Four years later it emerges how positive the legacy is. As Jim Sillars reminded us, Scots performed an act of sovereignty – and one which the rest of the UK, led by Prime Minister David Cameron, was prepared to accept as binding on the UK.

So there is something to thank Cameron for after all, and I don’t think May has rescinded his acceptance – which is why she doesn’t want another referendum. While for the time being the debate must be channelled through Brexit, that will not alter the fact of the matter: Scotland may or may not become an independent country in the next couple of years, but it is, already and without argument, a country free to choose the future.