When The House with the Green Shutterswas publishedin 1901 it injected a much-needed dose of acutely-observedreality into the over-sentimental version of Scotland portrayed in the literature of the time. George Douglas Brown based much of the novel on his life in the Ayrshire village of Ochiltree, where he was born. So the news that his birthplace is to be saved from dereliction is welcome for those who value Scotland's literary heritage.

After a long life as the British Legion club and social hub of the village, the house lay empty - and deteriorating - for almost three years after a fire and a lack of insurance cover. Now it has been bought by a long-time resident of the village and it may have a new lease of life as The Green Shutters pub.

The fate of another Scottish house with important literary associations, however, remains perilous. JM Barrie's boyhood games in the garden of Moat Brae House in Dumfries were the inspiration for Peter Pan's adventures in Neverland, but the overgrown garden has been used as a drugs den and the house vandalised to the point where it is categorised as "at risk" by the Scottish Civic Trust.

The handsome Greek Revival villa was home to the Gordon family, whose sons were friends of Barrie while he was a pupil at Dumfries Academy. Later, the playwright revealed that in that Dumfries garden: "When the shades of night began to fall, certain young mathematicians changed their skins, crept up walls and down trees, and became pirates in a sort of odyssey that was afterwards to become the play of Peter Pan."

It was run as a nursing home, but closed in 1997 and was bought at auction for £80,000 in 2000 by a Paisley businessman, James Brown. His plans to turn it into a hotel have not come to fruition and it was broken into and the interior destroyed.

Despite being B-listed in terms of architectural merit, it remains derelict and has been boarded up by the council for security. Tommy Holmes, the local councillor, has been lobbying - unsuccessfully - forDumfriesandGalloway Council to buy it, by compulsory purchase if necessary. "I am very frustrated that we have not been able to get the council to move on this," he says.

"It has a historic importance for the town and it is causing problems in the area because people have broken in to use it for taking drugs. The garden is so overgrown that the neighbours in sheltered housing are complaining about the lack of light." A council spokeswoman said its jurisdiction was restricted to planning.

Nevertheless, the council has been keen to tap into the tourist potential of the area's many literary connections. In 2000 it launched a literary guide featuring more than 100 authors who were born, educated or lived in Dumfries and Galloway.

Barrie features along with Robert Burns, Thomas Carlyle and lesser-known local talents such as Susannah Hawkins, a pedlar-poet who sold her own verse.

Una Richards, director of the Alba Conservation Trust, a building preservation trust with a remit to deliver sustainable new uses for cherished historic buildings whose survival is threatened by disuse, dereliction or demolition, says: "Most buildings preservation bodies deal with buildings of architectural merit, but whether a building is important may depend on the person associated with it."

The Alba trust is an umbrella body for a number of local building trusts; one of them, the Cockburn Conservation Trust, is restoring Liberton Bank House in Edinburgh, where Arthur Conan Doyle, the creator of Sherlock Holmes, spent his childhood holidays. The work, largely financed by a grant from the Heritage Lottery Fund, should be completed this summer.

The Dunedin School for children with special needs will then move in and the building and garden will be open for community and literary events during school holidays and at weekends. Richards says that one of the problems in getting funding for Liberty Bank was the fact that it was in Historic Scotland's lowest architectural category of CS, and the Conan Doyle connection was not regarded as important enough to raise its status.

It may be even more difficult to argue the case for the former Stromeferry Hotel at Strome- ferry near Kyle of Lochalsh. It is not a writer's home, but the inspiration for a fictional counterpart. It features in Iain Banks's novel, Complicity, as the run-down hotel where a murder takes place.

However, it is in the "at risk" category in the Scottish Civic Trust's Buildings at Risk register. While the Scott monument has dominated Princes Street gardens since 1846, at the opposite end of the scale is Abbotsford, Sir Walter Scott's grand country house near Melrose, which has been open to the public since 1833. Yet even its future was in question after the death of Dame Jean Maxwell-Scott, his great, great, great grand-daughter, in 2004.

Dame Jean's hope that another member of the family would take it over proved unsustainable, but it has just been taken over by the Abbotsford Trust. Jacquie Wright, the administrator, says the property is in need of considerable investment.

"A house like this is like the Forth Bridge - it needs continual maintenance, and one of our key objectives is that it will become self-sustaining," she says. A feasibility study is due to be completed next month, and development plans are likely to includebetterpresentations about Scott as well as commercial ventures such as weddings.

Any doubts about the interest in our literary heritage and the growth in book-related tourism are dispelled by the explosion in visitor numbers to Rosslyn Chapel following the publication of the Da Vinci Code. That had a significant spin-off for Abbotsford, as Scott modelled his library there on the chapel.

But the neglect of our literary heritage is nothing new. It was Robert Burns who paid for the stone on the grave of Robert Fergusson after discovering there was no memorial to the poet he greatly admired.

The Friends of Robert Fergusson raised £37,000 for a statue of the poet; it has also installed a plaque on the former Nicholson's coffee shop in Edinburgh, noting that JK Rowling started writing the Harry Potter series, and another at Rutherford's bar, marking the fact that it was frequented by Robert Louis Stevenson when he was a student. Bob Watt, one of the Friends, is now campaigning to have William McGonagall - frequently cited as the world's worst poet - commemorated alongside Scotland's greatest poets in Makars' Court in Edinburgh.

Some 29 writers from the fourteenth century onwards are commemorated by engraved slabs outside the Writers' Museum, which houses collections of artefacts relating to Burns, Scott and Stevenson.

The birthplaces of Barrie in Kirriemuir and Carlyle at Ecclefechan and the family home of the Angus poet, Violet Jacob, the House of Dun near Montrose, are all in the care of The National Trust for Scotland. Houses where Walter Scott, Robert Louis Stevenson and JM Barrie lived while in Edinburgh all have plaques highlighting their famous former occupants.

As Alison Bowden, manager of the Edinburgh as Unesco world city of literature project, says: "It is a visitor-friendly thing to do."

Burns's home in Alloway has only just been granted £10m to help transform it into the centrepiece of a new heritage trail highlighting the bard's contribution to world literature. It will finally be a fitting tribute to Scotland's bard. It remains to be seen if the rest of our literary heritage will be as well protected.