Margaret Thatcher ordered her ministers to seek cuts of up to a seventh of the Scottish Office budget as the nation's economy was in acute difficulties, according to official government documents.

But the release of the 24-year-old Conservative government papers this week was held up for nearly two years by the Scotland Office, as part of the UK Government, which sought to block publication under the Freedom of Information Act.

It argued the documents would "undermine the economic interests of the United Kingdom or part of the UK, or the financial interests of any administration in the UK", but was overruled by the Whitehall information commissioner.

This links to the current debate over the future of the Barnett formula, the means of distributing £30bn of annual Treasury grant to the Scottish Parliament.

With an SNP researcher asking to see the files, the attempt to keep the documents secret underlines how sensitive the question of Scotland's share remains to the government 24 years after this Whitehall battle took place.

The documents cover a dispute in 1984 between the Chief Secretary to the Treasury, Peter Rees, and Scottish Secretary George Younger. They show how St Andrew's House civil servants planned with their ministers and worked with the Northern Ireland Office to thwart the Treasury.

And in a series of robust exchanges at Whitehall meetings, the Treasury was warned that Mr Younger would resign if the Scottish budget faced a sharp cut. This was at a time that Linwood car plant and Invergordon smelter had just closed, while British Leyland at Bathgate was facing closure. The Scots warned that a cut would be spotted by the opposition and journalists, and it would be "crazy" to help rejuvenate what was then a dispirited movement for devolution.

The exchange began with a letter from Mr Rees saying the Prime Minister, then Margaret Thatcher, had seen a Treasury assessment of how much was needed to provide public services in Scotland, Wales and Northern Ireland. Under her instructions, he sought to slash the budget and change the budgeting process so that Scotland would have to fight each year for the size of increase it could expect on a new baseline figure.

The Treasury claimed nearly £900m more than necessary was given to the Scottish Office in 1983-84. St Andrew's House officials reckoned that would have been removed from the £6150m budget planned for two years later. They said that would mean no increase, even for inflation, for the following six years.

Through the process, the threat of a cut fell to £100m. But Mr Younger warned that it was politically impossible for him to slice the Scottish Office baseline budget.

The civil service response to the Treasury was to attack its methodology. It also argued Scotland's relative need, particularly with the nation's poor health, justified retaining the Barnett formula, which had been introduced six years before.

The Treasury proposal was described in one briefing paper as "indefensible in terms of the quality of the technical material and in political terms it would be unrealistic and disastrous". Another said the Treasury "seem determined to cut Scotland down to size even if it takes them years".

And in internal memos, another ridiculed the Treasury position by quoting a Flanders and Swann song: "The English, the English, the English are best, I wouldn't give a tuppence for all of the rest".

Alex Neil, the SNP Central Scotland MSP, claimed the attempt to keep the papers private showed there has been little change in Treasury behaviour since 1984, and that Labour and Conservatives at Westminster are considering the Scottish block grant for new cuts.