I can remember watching the Olympics as a 10-year-old and being so inspired by the spectacle that I restaged the events in my backyard, excitedly competing (against myself) to set a series of make-believe world records. When it was announced in 2005 that London had won its bid to stage the 30th Olympiad, I was pleased: now the Olympics really would be coming to my backyard. But I didn't expect to feel excited. And as the opening ceremony grew closer, and the stories of mismanagement multiplied, I feared the worst.

I was wrong. Most of us were wrong. The last two weeks have been amazing.

I'm embarrassed to admit how many times my eyes have welled up. And even more embarrassed that the cause has usually been a British medal.

"Patriotism is the last refuge of the scoundrel," Samuel Johnson said. I've not often felt proud of being British. But pride of some sort seems to have affected most of the country.

There are different kinds of pride contained within it: civic or county pride (Yorkshire has had a great Games), ethnic pride (in seeing black British or mixed race athletes win gold), family pride (as felt by parents, partners and children). But they all come under the one flag.

What's wonderful about the crowds waving their union flags inside Olympic venues or sitting in front of giant screens across the country is how diverse they are, yet how united.

The Games have been the most inclusive event in Britain in my lifetime. They've reclaimed the flag from the bigots and sectarians who use it to divide us one from the other. They'd done so by highlighting qualities we can all celebrate – not the worthless tat of celebrity culture, but physical prowess, mental agility, tactical skill, speed, endurance, dedication and hard work.

Pride is a dangerous thing, a precursor to arrogance and hubris. We should not start deluding ourselves that we're the third most powerful nation on Earth just because we're sitting third in the medals table. Luckily, most Brits have a saving sense of irony. The Games are only games. Those pink and purple outfits the Olympic volunteers wear set the tone. So did the humour in Danny Boyle's opening ceremony.

There's been something ever so slightly camp about these Olympics, a joke we can share, something to enjoy together but not to be taken too seriously. Runners in yellow shoes? That chap on the motorbike leading out the cyclists in the keirin? Britain winning medals? Pull the other one.

Humour wasn't much in evidence in the build-up to the Games. Columnists solemnly declared it our moment of truth, the 17 days that would tell the world, and ourselves, what Britain stood for. The completion of the Olympic Park venues ahead of schedule might have been taken as a good sign; the procession of the Olympic torch as a measure of the public's enthusiasm for the Games; Bradley Wiggins's victory in the Tour de France just a week before as a mark of how well our athletes might perform. But the mood was sceptical. Slightly panicked, too, as if a sporting festival begun 2,000-odd years ago in Athens might lead to Armageddon.

Would London be able to cope with the influx of visitors? What impression of Britain would our guests have if they suffered long queues at passport control, overcrowded trains and traffic gridlock caused by VIP lanes? Boris Johnson's voice could be heard at tube stations, warning of disruption. And motorway signs urged those travelling to Olympic events to allow plenty time and plan their journeys carefully.

But who were these people? It seemed very few people in Britain had succeeded in getting tickets, no matter how many hours they'd spent on the Locog website. Resentment mounted.

I felt it myself, not just for failing to get tickets, but because of what was happening where I live in south London, where most of Greenwich Park was closed for three months in order to stage the equestrian events and where ground-to-air missiles were installed on Blackheath. The missiles were allegedly there to combat any terrorist attack, but their mere presence was scary.

At the 1972 Munich Olympics, 11 Israeli athletes and coaches had been shot dead. Would security be any tighter 40 years on? When G4S admitted that it could not provide the 10,000 security staff it had been paid millions of pounds to recruit, the omens looked grim. The spiralling cost of the Games, the bullying demands of corporate sponsors, the ineptitude when a bus bringing a visiting team from Heathrow to Stratford got lost because the driver couldn't operate his satnav – Sebastian Coe's great dream was threatening to become a nightmare. And it wouldn't stop raining.

The opening ceremony lifted spirits. Even if you missed the history lesson underpinning it, about our transformation from smock-clad-peasants-round-a-maypole feudalism, through smoking-chimneys industrial revolution, to digital togetherness, the spectacle was terrific. Children trampolining on NHS beds while the Queen parachuted into the Olympic stadium with James Bond – it was eccentric, bonkers even, but very GB.

Our early hosting when competition began wasn't encouraging, however. The North Korean women's football team walked off the pitch when the South Korean flag was displayed instead of their own. Worse was the sight of rows of empty seats. Was it foreign sports federations that were failing to use them? Or corporate sponsors? Whichever, it was a disgrace.

Miserabilism was growing, and things weren't much brighter for Team GB. After Mark Cavendish failed to deliver on the first day, Lizzie Armitstead in the cycling road race and Rebecca Adlington in the 400m freestyle gave us a modicum of respectability, with a silver and a bronze. But next day it got worse again, when Tom Daley and partner screwed up their fourth dive.

Our swimmers took their failures in good heart; one recommended swimming as a way of staying fit. This wasn't the ruthlessness billions of lottery money had been spent on. Even Ben Ainslie, one of our gold certs, was struggling. By the end of the fourth day, Team GB was a lowly 20th in the medals table. Though our athletes praised the crowd for their tremendous support, the pressure seemed to be getting to them. Home disadvantage.

Day five brought a gold at last, for our women double scullers. And the sun came out for Bradley Wiggins. Team GB climbed to 11th in the medals table. Next day was even better. Three golds – Chris Hoy and team in the cycling, Peter Wilson in the double trap (clay pigeon shooting), and a gold and silver in the men's canoe slalom. By the end of the day we were up to fifth in the table.

Still, no one could have predicted what happened last Saturday, 4 August 2012, a day to match or even eclipse 30 July 1966 in British sporting history: six gold medals in one day, and three athletics golds (Jessica Ennis, Mo Farah, Greg Rutherford) in a single evening session.

The roar in the Olympic stadium was extraordinary. Over at Wimbledon, as Andy Murray reached the tennis final, a new chant went up: Gee-Bee clap-clap-clap, Gee-Bee clap-clap-clap. When the men's football team went out the way our national teams always do – in a penalty shoot-out in the quarter finals – it seemed inconsequential, comical even, not a cause for grief. There was too much else to delight in.

The delight isn't just a matter of winning medals, but it helps. And British success has continued through the second week: the fabulous Brownlee brothers, Chris Hoy, Laura Trott, Jason Kenny, Nicola Adams, Jade Jones and many more. Bums on seats were always a good bet for British medals; our boats, bikes and horse riders tend to do well. But gymnastics? Boxing? Taekwondo? The triathlon? Our national self-image has been severely challenged. We thought we were losers. And we're not.

Some of the failures were equally enthralling. So, too, was seeing the joy of less privileged nations as their athletes won gold, or hearing stories of competitors overcoming adversity (injury, bankruptcy, bereavement) during their preparations. Accusations of cheating have been few. And if Team GB has benefited in those sports where judges give marks (equestrianism, boxing, gymnastics), that's par for the course with host nations.

There have been few drug scandals, so far. One US coach insinuated that 16-year-old Chinese swimmer Ye Shiwen's world record was "disturbing". But when 15-year-old Katie Ledecky won the 800m freestyle for the US, he kept his mouth shut. Another swimming gold was won by 15-year-old Lithuanian Ruta Meilutyte, trained in Plymouth. Teenage success has been a big story at these games. At 23, Rebecca Adlington says she's now too old.

Have the Games been an escape from reality? Not for athletes and their coaches but for the rest of us, yes, of course. The economy's still a mess, Syria is at war with itself, and David Cameron is prime minister. But for 17 days we could forget all that. The broadsheets and tabloids became one long sports section. Even the news on Radio 3 one day began with a couple of sports stories. If we'd landed on Mars no one would have noticed. We did land on Mars? I must have missed it.

Those of us without tickets had to rely on television and Radio 5. This was the first digital Olympics, and the red button gave us unprecedented freedom: the right to roam, if only the length of the sofa. With due allowance for jingoism, the BBC coverage was generally excellent, and atoned for its performance at the Queen's diamond jubilee.

Inevitably some of the commentary was vacuous ("He gave that everything" – it's the Olympics, stupid, why wouldn't he?) and I swear I heard Tim Henman say that Andy Murray beat Roger Federer by forcing him into unforced errors. But few athletes were described as having medalled, and none of having podiumed. The women commentators and analysts (Hazel Irvine, Denise Lewis and, above all, Clare Balding) came out top, overshadowing John Inverdale and that bland punster Gary Lineker.

And the athletes were so well behaved. Win or lose, they'd walk straight from competing to give interviews. Goldie Sayers, the British javelin thrower, broke down with an injury during her event, then broke down in tears in front of the camera. Victoria Pendleton was tearful too. Some of the losers spoke of the four-year "journey" they'd been on and apologised for letting us down.

They needn't have. The vast majority of Olympic competitors are bound to leave empty-handed. For many of those athletes who broke into smiles as they entered the stadium during the opening ceremony, that was as good as it got. By next lunchtime, some of them had already been eliminated.

Much of the talk about legacy and the next generation is hollow. It is hard to see how young people in my area, for instance, will have been inspired by the dressage event at Greenwich. And I'm not sure I want them to be inspired by the shooting competitions that took place in Woolwich. But plenty of other Team GB successes are inspiring.

And we've also learned about sports we don't excel at, such as handball, which ought be introduced at every school in the country (all you need is a ball and a set of goalposts). We're as sports mad as the Aussies just now and we should build on that. Academic achievements won't suffer if PE is given more time on the curriculum. They might even flourish. Mens sana in corpore sano.

Come Monday, many of us are going to feel very flat. But there are images that will live on: the amazement on sculler Katherine Copeland's face (reminiscent of Kelly Holmes in Athens) when she realised she'd just won gold and mouthed to her partner Sophie Hosking "We're going to be on a stamp"; the Russian high jumper Ivan Ukhov failing to find the competitor's vest he'd removed after a previous jump and clearing the bar in a floppy T-shirt instead; the women heptathletes linking hands as they paraded round the stadium with Jessica Ennis; Usain Bolt's sprint double and David Rudisha's 800m world record; Bradley's sideburns, Jessica's smile. Most of us alive today won't experience another Olympics in this country. Like all good things – like parties, like the 100m, like life itself – the Games will soon be over, and far too quick. But the Paralympics are still to come. And I have tickets for those.