The Scottish parliament’s Brexit bill is “perfectly practical” and in keeping with EU principles of legal certainty and continuity, the supreme court has heard.

Backed by senior legal representatives from Wales and Northern Ireland, Scotland’s chief legal officer, James Wolffe QC, argued on Wednesday that the emergency bill – designed to sidestep Westminster by taking direct control over the repatriation of significant EU legislation – should not be struck down because it does not cut across EU or UK laws.

The UK government mounted an immediate legal challenge to the “continuity bill” after it won cross-party support from the Scottish parliament in March. The move further entrenched the constitutional battle between Westminster and Holyrood for post-Brexit powers.

On Tuesday, the UK government’s Scottish law officer, Richard Keen QC, argued the bill was “fundamentally inconsistent” with Westminster’s EU withdrawal bill and could not stand.

But Wolffe insisted it was “perfectly practical” for the Scottish bill to prepare the statute book in anticipation of the UK leaving the EU, pointing out this had been the approach taken by the UK government. He added that it was “plainly” not incompatible with EU law, which he said was based on principles of “legal certainty and continuity”.

Wolffe also stressed that the Scottish bill was passed several months before the UK’s withdrawal bill became law, saying that “it was not intended to modify the UK bill and could not do so”.

In May, Holyrood rejected the UK government’s EU withdrawal bill by 93 votes to 30 after Scottish Labour, the Scottish Liberal Democrats and the Scottish Greens backed Nicola Sturgeon’s decision to oppose post-Brexit power-sharing plans.

Michael Fordham QC, speaking for the Welsh counsel general, told the court Lord Keen’s claims about the bill cutting across the reserved field of international relations were “wrong and incoherent”, and the baseline for consideration should be that all devolved legislatures “already have competence”. The Welsh assembly had passed a similar continuity bill before reaching a compromise with the UK government in April.

John Larkin QC, the attorney general for Northern Ireland, also supported Holyrood’s capacity to legislate on Brexit, insisting “the Scottish parliament has done its work … The attribute of competence is something that belongs to the Scottish parliament”.

The court is expected to return a judgment later in the autumn.