Four years ago I won the BBC Alfred Bradley Bursary Award. For those of you who don't know, Alfred Bradley was an innovative producer who discovered and nurtured many writers.

Among the dramatists he helped to launch during his career were Alan Plater, Keith Waterhouse, Alan Ayckbourn and Stan Barstow.

When he died the award was set up in his name. Previous winners include Lee Hall, who went on to write Billy Elliot. The award was a big fat cheque and a commission for the afternoon play slot. The idea was to produce the winning script. Well that was the idea.

There was a problem. My script wasn't suitable for the slot. The BBC suggested I pitch them with more ideas. I did. Four years later I finally got one accepted. This was partly my own fault - I just couldn't get my head around the criteria for the afternoon slot and partly bad luck - producers went on maternity leave, producers left to work on Shameless, producers came and went.

Those four years generated a lot of story ideas. I think I went through about seven commissioning rounds in the end. And I must have pitched about three or four ideas each time. I'd more or less decided to give up. I'd been to see Alan Bennett's The History Boys, and watching it I was transported back to my own school days.

Not, I should add, because they bore any resemblance to Bennett's play, in fact it was the converse. Watching it, I was struck by what a well-written piece of nonsense it was. This is a school where the pupils use words such as meretricious' and whole scenes are acted out in French. There was not one solitary note of recognition with any of the characters; either with the way they spoke, the way they behaved, or the way they interacted with each other. It is supposed to be set in the 1980s.

Well I was at school in the 1980s. It was a very different school. Built in the 1960s on a bit of marshland on the outskirts of Salford, it was made from plasterboard, so as not to sink.

By the time I got there in 1982, the science labs were on the same level as the sports field (a metaphor there if you want one). There were holes in the walls where lads had been practising their head butts or trying out their new steel toe-capped Doc Martens. And the only people famous to come from there were The Happy Mondays. I used to listen to them practice at the community centre next door. They'll never amount to much, I thought.

In the first year I got friendly with a lad called Simo. We bonded over wagging off school and stealing stuff. We got into so much trouble together that in the end there was a meeting with our parents and the head and it was agreed we would have to be formally separated.

They were going to expel the pair of us but Miss Cohen, I think, said that we would only hang out together off grounds and get into more trouble. It was then decided that one of us would be excluded for a year and the other would have to sit in isolation outside the headmaster's office for a year. They couldn't decide who should have which punishment so they tossed a coin for it.

I was very lucky that day - I got to sit outside Mr Byron's office for the year. A blessing in disguise of a punishment. Simo was not so lucky. I wasn't allowed to see him so our friendship ended there, but he started hanging around with some older boys who had also been excluded and his anti-social behaviour escalated. I heard whispered rumours about him from time to time: Simo's got caught with a shopping trolley full of radios from Dixons, Simo's got a kicking from Greeney (the local plod), Simo's got into glue, Simo's gone off the rails; but I was never able to substantiate these rumours.

I was on my own. Cut off from the world. All I had was an exam table full of scratched tags and a peeling magnolia wall to stare at. Human contact came at nine o'clock and then again at three-thirty. It was exactly what I needed - to be left alone without distractions. I poured myself into my studies. At the end of the first year I was in the bottom Maths and bottom English groups which was humiliating beyond belief. That year in isolation I taught myself more than adequately, because when I came to do the tests at the end of the year, I had scored one of the highest marks for both my English and Maths (I think Ian Allen was the only one that year who achieved a higher Maths grade).

Amazing really. So when I went into the third year, I was put into the top groups. I did really well for the first six months but then got bored and started getting into trouble again. Oh well. The thing was, I met Simo a few years after I left school. I think I was 19 or 20, in a pub in Swinton (in Salford). He had just come out of Strangeways - he'd been banged up for twocking (Ashley in my play is a twocker). Oh the fickle finger of fate.

So then, here was my subject, thanks to Mr Bennett. His play didn't relate in any way to the sort of education system I went through, and I thought what would it be like if I had written it. And that's really how Excluded came about. Hopefully there's a wider metaphor though, which is that everyone feels excluded now. I've felt for a long time that there's a big hole in the middle of what we call society and everyone feels on the outside of that looking in. We think of social exclusion as a phenomenon of social class, but I think it affects rich and poor alike.

When I started to write the play, I realised that I didn't know anything about modern schools. Discipline in my school was predicated around the clip round the ear' method, of if you went really out of line - the stick. I realised I'd have to go back to school to find out. I went to four schools in Bradford - all very different. I was shocked by how much it had all changed. There were no head-shaped holes in the wall, instead there were posters with rules - six stripes must be showing at all times' was one of them. Five or seven stripes showing on your tie results in a consequence.

There were CCTV cameras and teachers patrolling the corridors with radios. This was very much a Foucauldian policed space. The funny thing was, I could see it from the teachers' perspective now. You've got more than 30 kids in a class, of course you want them to do as they're told. But where does the individual fit into this? There is a conflict being played out, which fits into a wider conflict, that is the dynamic between individual freedom and social cohesion.

I spoke to excluded pupils and kids in the isolation units. Another difference. In the dungeons of most modern schools there is a room where naughty kids are sent where they are annexed off without any contact. This is the starting point for my play.

Three kids who have been isolated. It is the morning of an OFSTED re-inspection and the school faces the prospect of being closed down - with the outcome of the teachers having to re-apply for their own jobs. The headmaster has a solution - to take the three kids off grounds. He deploys his PE teacher to do this. A man so jaded and washed up, he is practically finished.

Of course things go very wrong. There's a lot of comedy to be had, but I wanted to stay true to the situation and characters. And I certainly didn't want to give it a happy ending, although there is a chink of light - as there is in real life. Consider me and Simo. I am aware that had the coin landed on heads instead of tails, I'd be telling a very different story.