THERE was a glorious irony to the arrival of I Am Thomas at the Salford-based Lowry arts centre, so named in honour of the northern English city's most famous artistic son. Here was a new piece of theatre presented by the gloriously irreverent Told By An Idiot company in a co-production with the National Theatre of Scotland and the Royal Lyceum Theatre, Edinburgh, where it opens tonight, that told the little-known story of Thomas Aitkenhead.

Aitkenhead was a student in seventeenth century Edinburgh, whose loose-lipped anti Christian proclamations might in enlightened times been easily dismissed as attention-seeking banter and adolescent posturing. As it was, twenty-year old Aitkenhead ended up being the last person in Britain to be hanged for blasphemy.

Meanwhile, in twenty-first century Salford, the local council have just brought in a Public Space Protection Order in a bid to curb anti-social behaviour in the gentrified Salford Quays area. Part of the order states that it is a criminal offence for anyone to use what is described as "foul and abusive language." How this is defined isn't clear, though such an edict may well cover more than one colourful expression, especially those uttered by football fans on their way to or from watching Manchester United at the nearby Old Trafford ground. While not a hanging offence these days, on the spot fines of £100 could be incurred for those indulging in such a crime.

“It just makes you want to curse and curse and curse,” says composer Iain Johnstone of the Salford initiative. “How are they going to do it? Have a list of set words? I can't really see how something so ridiculous would work.”

Johnstone's observations point up the absurdity of such restrictions just as comic activist Mark Thomas' plan to have a swear-box at his forthcoming gig at the Lowry does. Both sit well with Told By An Idiot's approach to the story of Aitkenhead, which Johnstone first mooted to Told By An Idiot director Paul Hunter more than two decades after discovering it for himself.

“It was around the time of the fatwa on Salman Rushdie,” Johnstone explains, “and I can't remember whether I heard about it from someone, or whether I read it in George Rosie's book, Curious Scotland, but it really struck me at the time that history repeats itself. Most countries go through that, but it just so happened that Britain and Scotland went through it earlier.

“It's fascinating that the story of Thomas Aitkenhead has been pretty much swept under the carpet, and I remember writing to the City Chambers and saying that it's great having statues of Nelson Mandela and what have you, but how about putting up one of Aitkenhead. I didn't get a response, but maybe now's the time to start rattling a few cages.”

Given that as well as being artistic director of Edinburgh-based children's theatre company, Wee Stories, Johnstone is a long term collaborator with Told By An Idiot, the idea seemed tailor-made for the company.

“Iain said he wanted to do a new piece of music theatre in the spirit of what Brecht and Weill did with something like Flight of the Lindbergh,” says Hunter, “and even though Told By An idiot had never done a piece of total musical theatre, the story of Thomas Aitkenhead seemed to lend itself to that. There was something there about the timing of Aitkenhead's execution, which took place ten years before Scotland and the Scottish Enlightenment changed the world. It was as if the authorities realised they'd gone too far.”

Once Told By An Idiot teamed up with the NTS, rather than develop what became I Am Thomas with a writer in a conventional way, the company worked with an original short story by James Robertson called The Wrong Place. As author of the novel, The Fanatic, which in part looked at a modern-day tourist guide's obsession with Thomas Weir, a seventeenth century Presbyterian who was executed for alleged witchcraft, Robertson's affinity with such yarns was again in accord with Told By An Idiot.

Hunter, Johnstone and co also brought on board poet Simon Armitage to write eleven sets of lyrics for a show now described as 'a Brutal Comedy With Songs,' that looks to the loose-knit bawdiness pioneered by companies such as 7:84, Wildcat and Communicado.

“The show taps into that very Scottish tradition of musical theatre,” says Hunter, “and Simon's lyrics capture perfectly the sense of the sacred and the profane that runs through it. I remember Simon asking, why singing, and I couldn't answer, but we're working with a Zimbabwean actor and musician called John Pfumojena, and when you see what he does onstage, you can see how music and song can express things in a way that words can't do on their own. So that's why singing.”

For Armitage, “The main thing that came out for me was the parallel with the Easter story. Thomas Aitkenhead's walk down the Tolbooth to be hung had an immediate parallel with Christ's walk to his crucifixion and the fourteen stations of the cross. Christ was crucified for what he said, and so was Thomas Aitkenhead, even though he was in direct opposition to what Christ said, and there was an irony in that.

“Free speech is a huge issue, and it always has been throughout the history of civilisation, but every now and again it seems to tip over into public consciousness. There's obviously a clear relationship in the show with Charlie Hebdo in terms of it being all about free speech. If you call a play I Am Thomas you don't have to try too hard to work out the comparison.”

Armitage also mentions the rise of public debates in which some commentators refuse to share a platform with those they disagree with. Recent examples have seen the likes of long-time gay rights campaigner Peter Tatchell and feminist thinker Germaine Greer effectively black-balled by nominally liberal institutions.

“It leaves you with a dilemma,” says Armitage, “of whether anyone has the right to not be offended. By the same token, you also have to make sure people are safe, so it's not always straightforward, and it only becomes an issue when someone gets executed.”

While I Am Thomas sounds like a piece of very serious fun, rather than taking cheap potshots at people's chosen belief systems, it seeks to heighten the absurdities of how those beliefs can be abused.

“It's not an attack on organised religion,” Hunter points out. “It's more a plea for tolerance and understanding, which sounds quite simplistic, but is very pertinent just now. When people start trying to tell you what you can or can't say, that's very worrying, and even when looking at the sort of material we are with I Am Thomas, there's a presumption about how it should be done, and that it can't be irreverent. But we have been irreverent about something that is serious as well. One of my favourite films is Duck Soup by the Marx Brothers, which is this extraordinary anti war film that's also very silly.”

As Johnstone puts it, “There's a danger in this day and age of being over-respectful, and you have to be ever on your guard against that. You have to be vigilant.”

I Am Thomas, Royal Lyceum, Edinburgh, tomorrow to April 9; Eden Court, Inverness, April 12-16; Wilton's Music Hall, London, April 20-30.