The previous year’s £9m acquisition from 3i of the M&S toiletries wholesaler and the picking up of seven stores from Alldays had backfired disastrously, while the £40m bolt-on of Eddie Thompson’s 50-strong Morning Noon & Night chain was to prompt a £12m goodwill write-off. Debt had ballooned to £65m, while trading surplus had shrunk to barely £1m.

John Brodie, a modest accountant of 12 years with the firm, and the finance director who had been bringing the bad news to departed leader Colin Bird, was hastily promoted to company doctor, alias chief executive.

Four years on, the society has made a full recovery to celebrate its 150th birthday, and is going head to head with the likes of Sainsbury’s for the best new sites.

“We will offer a different proposition, because we are a more local business,” Brodie says.

“A lot of our product will be similar, because standard branded products are demanded by consumers in whatever location, but we will have a different range of our own branded products and we will try to meet consumer demand if it makes sense – we don’t have a national footprint that sits in every location.”

More than 50 of the 130 Scotmid stores have so far had the radical makeover needed to fight the Local and the Metro, the Semichem discount toiletries chain has been revamped and expanded across the border, and last year’s trading surplus jumped 37% to £9.2m. M&S was tidied up and offloaded a year ago for a £400,000 gain, just before the banking shutters came down, helping slash debt to £26m.

“We were not under pressure to sell and managed to secure an unsolicited offer,” Brodie comments, wryly describing the timing as “fortuitous”.

Scotmid has just reported first-half underlying profits up 16% to £4.6m, and “encouraging” trading. Its newest store opened recently on an Edinburgh site snatched from under the nose of Sainsbury’s, thanks to a smart deal with the Woolworths receiver that outflanked the retail giant’s big financial guns – and delighted local campaigners in the Stockbridge “village”.

Brodie will not comment on the deal but says: “Unfortunately very often financial matters will come into play. But a local voice is hugely important.”

He goes on: “From recent customer surveys the one thing that has come out clearly is we are the local store, and very often people don’t realise the scale of Scotmid as a business.”

What began in 1859 as an Edinburgh-based mutual now operates right across Scotland, has substantial property and funeral divisions and boasts a balance sheet of almost £100m. Behind it the UK co-operative empire, integrated at last into a single brand, offers critical economies in sourcing, helping the movement compete on price.

Brought up in Fife in a family business founded only a few years after Scotmid in 1865, Brodie says those values rubbed off.

He trained in accountancy at Fife College before joining Touche Ross (now Deloitte), arriving at Scotmid as financial controller in 1993. Though reluctant to talk down the business he inherited (“that would not be fair to staff”), Brodie does let slip that four out of five of the divisions were struggling, that the group had been “desperate for cash”, and that “Semichem and M&S were not going in the right direction and had lost their focus”.

His “back to basics’ regime included a new management structure and the sale of £10m of investment property to reduce debt. “We managed to offload a lot of the lower grade investment stuff which has left us with a more robust portfolio. We sold the more difficult stuff – which in hindsight turned out to be at the peak of the market.”

More painful was the shedding of 170 staff at Scotmid’s Victorian headquarters in Edinburgh’s Fountainbridge, home to a growing new business district. But that too proved uncannily well-timed: the group’s joint venture with developer Gladedale, forward-funded by Credit Suisse, to build a stylish glass headquarters building on part of its site attracted an ideal tenant, Bank of Scotland Corporate, in a deal tied up in the heady days of December 2007.

The surviving heritage building at Fountainbridge still houses the funeral business, but Scotmid has decamped, and already found a first tenant for its new head office development at Newbridge.

“The move to a new office was not only cash positive but importantly it was like a new start for the business culturally,” Brodie says.

“Instead of being in old-fashioned compartmentalised offices we moved to modern open-plan – don’t underestimate the positive impact.”

When firefighting three years ago, Brodie was still keen to stress that the big store expansion by his predecessor had exploited a genuine window of opportunity.

Scotmid added a further eight stores last year through taking out smaller independents, and the group says its market share has held up despite the convenience store land grab of the giants.

The expansion of Semichem, with up to 10 new stores rolling out into north-east England, now looks similarly opportune in the recession.

“But it is not a God-given right that we are going to do well,” Brodie cautions. “It is a very competitive market-place, there are plenty of discount offerings around.”

The member-owned business values its privacy and keeps like-for-like sales numbers, and the profitability of each division, under wraps. Brodie will only say: “They have all turned in a solid performance, they are all in profit.”

He continues: “ We have to keep improving what we do in the business. Four and a half years ago I said it was not going to be a quick fix, and we are here for the long-term.”

Meanwhile, the 150th birthday celebrations have included overhauling the society’s constitution to enhance member democracy, and put even deeper roots into communities.

It all adds weight to Brodie’s convenient war cry: “Scotmid is a Scottish business owned by Scottish people.”