In the delirious early hours of last Friday morning I tweeted that, finally, the nail was in the coffin for the grammar schools project. A hung parliament meant the Conservatives would have to form a coalition and that would be the end of that.

By 10am I was regretting my words: as the realisation dawned that Theresa May was not going to form a coalition but would instead hit up the DUP for a less rigid arrangement, I became more dejected. Suddenly I could see all kinds of ways she might make a pernickety argument for why grammars could, and should, still go ahead.

For example, if you only count English MPs, the Conservatives have a reasonable majority of about 300 to 276. Given education is a devolved matter, perhaps May would argue the election had returned her a thumbs up for grammars and she would plough on.

“Stop worrying,” came the messages from people in the know. “She is not going to do grammar schools,” their text messages said.

But these days I think of the grammar schools policy like zombies in a B-movie. Just when you think our heroes have flattened it and there are celebrations all round, a hand bursts through a window and starts strangling them all over again.

It was an extraordinary coalition, the sort Theresa May can only dream of

Hence, I was not surprised that after my joy on Friday, by Sunday this hand was indeed popping through my telly screen and starting to squeeze.

Okay, that’s a slight exaggeration. But Graham Brady, the Conservative MP who heads the influential 1922 Committee that’s now pretty much in charge of Tory party policy, was on the Sunday Politics talking about the government’s predicament on new selective schools – and the fact that it was looking distinctly unlikely they could now make it through parliament.

“I would be upset if no progress was made” on grammars, he said, before suggesting a “rather modest sort of pilot” of them instead. Brady needs to explain how anyone can “pilot” something which is currently illegal, of course. As one cheeky tweeter wrote, perhaps we might consider a modest pilot of proportional representation for his seat at the next election?

In either case, I dusted off my zombie-hunting gear once more.

As the week unfolded, however, more and more voices – including those close to conversations over at Downing Street – are telling us the grammar thing isn’t going to happen: it is gone for good. Nick Timothy’s resignation has made that even more certain.

If correct, this should allow schools a sigh of relief, and also raise a cheer for how the sector came together to fight for the cause. At another time, it may well have been easier for a government to get the policy passed. But, like the Scooby Doo gang, we were just too pesky to let them get away with it.

Becky Allen’s statistics over at Education Datalab and Chris Cook’s number-crunching at Newsnight gave the hard evidence on outcomes. Sam Freedman, Gove’s former advisor, wailed on Twitter until every self-respecting journalist and political commentator was on his side. The unions fought smart. The NUT has already sent legal letters to schools trying to create backdoor grammar schools and promised to judicially review any moves to open new ones. Joanne Bartley and the team at Comprehensive Future, put in hours to get data on the 11-plus as it currently exists, giving ammunition to the parliamentary committee that looked at grammars.

It was an extraordinary coalition, the sort Theresa May can only dream of. And, it seems, it worked.

I would also like to say at this point that I’ve been impressed by two further groups who have unnecessarily had it hard during this grammar debate period. The Secondary Modern Association has tirelessly pointed out that their schools are not second-rate. Many are amazing. But they work with the odds stacked against them. Likewise, the grammar school heads who have all got in touch with me have been uniformly polite and interested, and the fact so many are starting to sponsor comprehensive schools is, I hope, going to be a way of sharing their resources across the system.

I think we may finally be at the end of the movie. The camera is backing away and the credits are about to roll. But there is a final shot: of a zombie, or in this case, a document titled “grammar school plan”, still lurking in a cupboard. One must always be ready for a sequel.