Earlier today Scotland’s highest court agreed to refer to the European court of justice the question of whether the UK can remain in the EU on its present terms, unilaterally revoking its decision to trigger article 50 of the Lisbon Treaty.

The Scottish court of session rejected the core argument of government that none of this matters because its policy is to leave. It said: “It seems neither academic nor premature to ask whether it is legally competent to revoke the notification and thus to remain in the EU.”

This is a key moment in long-running litigation vital to our national interest.

There is no reason to believe the other 27 member states would, even at this late stage, block us from remaining. Indeed, there have been a number of high-level indications that the UK can change its mind. But there are still vital questions left unanswered.

As things stand, the UK enjoys a privileged relationship with the EU. We have been able to negotiate a rebate worth around £80m a week that has the effect of reducing the contributions we make towards the EU’s running costs. We have secured an opt-out that lets us keep control of our borders. We have no obligation to join the euro. We have enhanced rights to make our own labour laws. And so on.

But, were we forced to seek permission to remain, the EU might look to hug the UK closer to the union. The price of permission might be the giving up of certain those privileges. There have been suggestions to this effect in the past from senior EU politicians. But if we have the legal right to withdraw our notice then that possibility evaporates. We can keep the deal we presently have. Legally speaking, it can be like Brexit was all just a bad dream.

But the present state of affairs, with all the uncertainty, has very real political implications. The pro-Brexit press is already pushing the narrative that giving up the rebate and opt-out would be the price of remaining in the EU. And, at least as matters stand, these risks cannot entirely be discounted. Left unresolved, this doubt will become a powerful weapon in the hands of leavers in any referendum campaign.

The other critical point is this. There is a clear consensus view among legal experts that – with the unanimous permission of the other 27 – the UK could choose to remain. But, although all independent international forecasters say Brexit will make the UK worse off, the same cannot be said with certainty about each of the other member states.

The slow dismantling of our financial services industry has already begun – and will gather pace if we leave. The EU will be able to act unencumbered by our veto or the need to have regard to our interests. It is bound to tighten the regulatory screw. A number of car manufacturers have indicated that they do not know whether it will be possible to function in the UK if there is a no-deal Brexit – and in any foreseeable model of Brexit their competitiveness will suffer. Even the intellectual doyen of leave economics, Patrick Minford, famously admitted Brexit would “mostly eliminate manufacturing” in the UK. To which existing member state might these financial services, these manufacturing plants, depart? Find one winner from the UK leaving the EU and it would have a legal veto on us remaining. Do we really want to take that risk?

We do not know what answer the court of justice will give. Legal opinion – both on the continent and in the UK – is divided on the question of whether unilateral withdrawal of the article 50 notice is possible. But what cannot be denied is that our national hand is hugely strengthened if the court of justice decides the question in our favour, so that we are no longer forced to go cap in hand for permission from the other 27 member states.

So what happens next?

In an interview given in November 2016, Eleanor Sharpston, the UK’s advocate general in the court of justice, speculated it would take “four to eight months” for the case to be decided. However, there is now a very real urgency that was lacking then. And there are examples of cases where a decision has been given within 10 weeks of the case being lodged. I understand from my conversations with sources in Luxembourg that a decision should be delivered before Christmas.

Meanwhile both sides must lodge written and then make oral arguments. The government, in particular, faces a rather interesting dilemma. Will it really contend that the article 50 notice cannot legally be withdrawn? Will it actively argue for a legal outcome that disempowers us in the article 50 process and diminishes our control over our own destiny? Or will it admit to political reality – that an in-or-out referendum on the final deal is a real live possibility and that its obligation is to look after the interests of the British people.

It is no exaggeration to say that this is a case that could decide the fate of the nation. It’s not too late to wake up from the nightmare.

• Jolyon Maugham QC is director of the Good Law Project and one of the petitioners in the case