The last time Simon Stephens was in Edinburgh, seeing the billboards outside the city's Festival Theatre advertising his award-winning stage adaptation of Mark Haddon's novel, The Curious Incident of the Dog in the Night-Time gave him a little swell of pride.

For all the phenomenal success of both the book and the play, which has seen Marianne Elliot's National Theatre production of Stephens' version transferring to both the West End and Broadway prior to its current tour which arrives in Edinburgh tonight, it felt a little bit like coming home.

"Edinburgh is very special," says the Stockport-born writer having just watched a new production of children's' musical Bugsy Malone at the Lyric Hammersmith, where he is an associate artist. "It's the city where I met my wife. I formed my band, The Country Teasers, there, and I lived there for two years, and started writing my first play in a flat above a shop on Broughton Street."

Such attention to detail and forensic memory recall seems to fit with The Curious Incident of the Dog in the Night-Time, which charts the getting of wisdom of fifteen year old Christopher Boone. A mathematically obsessed introvert who has never been beyond the end of his street, Christopher nevertheless creates his own world out of a set of codes and patterns which he lives by. When he finds his neighbour's dog murdered, Christopher becomes detective, and embarks on a journey that will take him physically to London, but which opens up his mind to an infinite set of possibilities.

When Haddon's book was first published in 2003 it became a publishing sensation, tapping into a mass consciousness enough to see its rites of passage story win multiple awards and go on to sell more than ten million copies. While one could reasonably argue that any stage version was onto a winner from the start, when Haddon first approached Stephens, this was the last thing on either writers' minds.

"I'm immensely proud if slightly gobsmacked by what happened," says Stephens today about his version, which he wrote without any kind of commission behind it. "The whole thing started off with me doing a favour for Mark and having a pop at it to see if I could do it. I loved the book, Mark was a mate and I'd never done an adaptation before, and I didn't want a commission for it, because that would have put a lot of unnecessary pressure on things. If I wasn't up to it, the only person I would have been letting down was Mark."

In the same spirit, Stephens passed an early draft of the play on to War Horse director Marianne Elliot, who had directed Stephens' 2008 play, Harper Regan, at the National Theatre. Out of this developed the idea to transform Christopher's first-person narration into a play within a play in which his teacher Siobhan begins the show by reading the story to her class. It was also decided to effectively set the play in Christopher's head, with his free-flowing series of thoughts being brought to life both by Bunny Christie's set and the movement work of Scott Graham and Steven Hoggett of Frantic Assembly.

"The entire process of doing the play was loads less pressure and lots more fun than it sometimes can be," says Stephens. "To create a dramatic language in the play that's alive and inside Christopher's head was something that was really liberating, and I think part of the fun for the audience when they see that is that they can recognise their own humanity and can feel part of what's going on."

One thing that has been raised about both the book and the play of The Curious Incident is whether Christopher's behavioural patterns can be attributed to Asperger's Syndrome or not. In this respect, however, although it is set in Christopher's mind, it is as far away from an issue-based play as it can get.

"For me it doesn't matter," Stephens says, "and I know that for Mark it doesn't matter either. In the rehearsal room I fought very hard for Christopher to be able to define himself by his personality than by his condition. On the other hand, I know Christopher's story has meant a lot to people who have Asperger's Syndrome, and how seeing the play has affected them, so I don't want to dismiss that either."

When Christopher says in the play that "Today is going to be a good day", his guileless sense of self reminds you of a terminal adolescent somewhere between singer/songwriter Daniel Johnston, who was diagnosed with bipolar disorder, and The Big Bang Theory's uber-geek, Sheldon Cooper by way of Holden Caulfield, the youthful narrator of J.D. Salinger's classic novel, The Catcher in the Rye.

Stephens is amused by such comparisons, but nevertheless notes that "Daniel Johnston is a great songwriter regardless of his condition, and the documentary that was made about him, The Devil and Daniel Johnston, is really moving. Watching it we know he's irritating, but we also know he's really talented, and I think it's the same with Christopher. We can all recognise ourselves in Christopher. I know I do, and I know Mark does as well, and even though we all know that empathy can be pretty exhausting at times, I think the audience recognises themselves as well. But I couldn't worry about that. I remember the first night, and all I was worried about was if Mark liked it or not. My job was to make Mark happy."

As for The Catcher in the Rye, Stephens acknowledges a little bit of Holden Caulfield in much of his back catalogue.

"I'm always writing teenage characters like that," he says. "My plays Harper Regan and Punk Rock are full of them. But The Catcher in the Rye meant so much to me when I was growing up, and I re-read it when I was writing Punk Rock, which is all about teenagers in a school, then wrote Curious Incident about six months later, so there's bound to be an influence there. But teenagers as people are innately dramatic anyway. As young people they're on the cusp of the world, and are about to set out on a great adventure, which is a bit more interesting than writing about middle-aged blokes like me. But the amount of seventeen year old characters I write, there's a thesis to be written there."

The Curious Incident of the Dog in the Night-Time, Festival Theatre, Edinburgh, April 28-May 9; Kings Theatre, Glasgow, August 18-22; His Majesty's Theatre, Aberdeen, September 1-5.

www.curiousonstage.com