When Chloe Moss was commissioned by Clean Break theatre company to spend 12 weeks developing a play from working with inmates in a women's prison, she was at first daunted by the terms laid down for her by the company, which was set up in 1979 by two female prisoners to explore the hidden stories of women prisoners through drama.

By the end of the process, however, things had changed dramatically for the Liverpool-born writer.

The change was more than evident in This Wide Night, the play that was born from Moss's experience with Clean Break and which played at Soho Theatre in 2008 prior to a tour of prisons where some of the women Moss had worked with were still housed. Now that a major new production, directed by playwright David Greig, is about to open at the Tron Theatre in Glasgow and featuring Jayd Johnson and Elaine C Smith in the cast, Moss can reflect on the play's origins.

"At first it seemed slightly restrictive," Moss explains, "Clean Break do one commission a year, and you write something that's for a small, women-only cast, and obviously you write something that's based around women who are in the criminal justice system. Once you're involved in it, all of that is actually quite liberating, and by the end of the 12 weeks I could have written 50 or 100 plays about the experiences of these women."

Rather than focus on the women's life behind bars, Moss's play looks at what happens when the women are released. This is done through two women, Marie and Lorraine, who had struck up a friendship while incarcerated. When Marie is released, that appears to be that. Only when Lorraine knocks at Marie's bedsit door are the pair forced to reassess their relationship on the outside world.

"The characters are really an amalgam of all the women I met," Moss says. "Even before we started, I was really interested in what happened when these women came out of the criminal justice system, and what happened to them. Bonds form between women in prison, but it's hard for them to trust people, so there's a fragility to those bonds, especially when the women get out.

"Many women lose ties with their children and with their families, and if you're a certain age, it's going to be more difficult to get work when you get out. That's a massive part of your life. I mean, what if you're 70 years old when you come out, and you've lost all those connections in life you had? What do you do?"

Women's prison drama has proved an alluring draw over the years, both on stage and on television. Both Within These Walls in the 1970s, Prisoner: Cell Block H a few years later, and the more recent Bad Girls have captivated huge audiences. If the latter two camped things up somewhat, such an approach was offset by Rona Munro's recently revived stage play Iron and the ongoing work done by Clean Break.

While This Wide Night has moved out of the prison walls, Moss's experience of her 12 weeks working with women has made her recognise the importance of dramatising experiences which most people are not aware of.

"I can only speak from my personal experience," she says, "but when you scratch the surface, you realise how many women are in prison, and how many of them are in for non-violent crime. The reasons a lot of women are in prison are to do with poverty, drugs or mental health issues.

"Where these women should be getting health and support, they get locked up instead. So if you scratch that surface, it feels very Dickensian, and the strength that these women have when they come out and have to try to rebuild their lives is remarkable."

While Moss stresses This Wide Night is not a journalistic piece of work, the play's sustaining power has proved something of a benchmark for the writer, whose career began after she was picked up by the Royal Court Young Writer's Group, where she wrote her first professionally produced play, A Day in Dull Armour, in 2002. Commissions for the Royal Court, Manchester's Royal Exchange and Liverpool Everyman followed.

"I'd always wanted to write," Moss says, "but I didn't think it was possible to earn a living doing it. My brother's an actor, and he was a big inspiration. I went along to the Everyman Youth Theatre a few times, and that made me realise I didn't want to be an actor, and that writing could be another way of telling stories. Then I started going to the theatre more when I did my degree in Manchester, and things took off from there."

Moss also has extensive TV credits under her belt, with stints on Hollyoaks, Secret Diary of A Call Girl and more recently on Switch, a fantasy-based comedy drama about four young witches living in contemporary Camden. With further commissions for the Royal Exchange and the Everyman pending, Moss may have moved on as a writer, but it's clear This Wide Night remains an important piece of work for her.

"I feel incredibly proud of it," Moss reflects. "It's an emotional thing for me. I have a real affection for it, and it's very close to my heart. Sometimes you look back at some plays and think 'would change that now'. I'm not saying this play is perfect, but it means a lot to me.

"When we took it round prisons, that was the most important audience for me. Some of the women I'd worked with had been released, but it was obviously still personal to them, and if I hadn't nailed the truth of things, they'd know in ten seconds. Even though there's a lot of bleakness in the play, I think there's also a lot of hope."

This Wide Night opens at Tron Theatre, Glasgow, on Thursday and runs to March 15.

www.tron.co.uk