When the curtain went up on the opening cerem-ony, Mhairi Spence was on a mountain top in the French Pyrenees.

Today, she aims to bring down the curtain on Britain's greatest Olympic Games by winning its final gold medal.

The 26-year-old has had to bide her time. It was not until last Tuesday that she entered the Olympic village and experienced first hand the euphoria surrounding Team GB. But her wait to be part of an Olympic team has been considerably longer. She missed out on Beijing four years ago in spite of achieving the qualifying mark as international rules restricted the team to just two female athletes.

Spence, from Farr, south of Inverness, has admitted that it was the low point of her career, one that dragged on so that even six months down the line she was struggling to come to terms with it. There were times she doubted whether she could muster the physical and mental effort required to go for another Games. After all, the qualification criteria were the same with just two athletes being selected and, one of her rivals, Heather Fell, had taken a silver medal in Beijing. In the end, even Fell did not make it, with Lancashire's Samantha Murray taking the other berth.

Training daily alongside her rivals for a place at Pentathlon GB's High-Performance Centre at the University of Bath helped spur on Spence but, in a sport with five disciplines (fencing, swimming, horse riding, combined run-shoot), it is easy for the mind to get cluttered.

Spence has spent many hours over the past five years with Deidre Angella, a sports psychologist at Bath, in a bid to get right her mental approach.

Her appointments may have started before Beijing, but it is only after the last Olympic Games that Spence realised their true worth. In the immediate aftermath of her world title win in Rome in May – a victory that confirmed her Olympic place – she acknowledged that Angella's advice had been invaluable to her success.

"Deidre gives me everything I need but it's up to me to use it," she said. "You can take a horse to water but you can't make it drink and it's really hard to remember everything you're given to do.

"I knew what I needed to do and had to bully myself into doing it. I did and it worked. I'm now going to have to go home and say to her: yes, you are right and I'm wrong."

The conversations between athlete and psychologist remain private but there are hints from Spence that there were some particular demons to drive away as she found it hard to accept that her training for Beijing had come to nothing.

"She's definitely a key member of the team I work with," Spence said. "She's helped me through lots of different stuff; the disappointment of not making Beijing. So many different aspects of our performance come down to mind over matter and being able to stay in the moment and not get carried away with the outcome.

"Without her, I don't think my results would have been the same as they have been for the last two years. Becoming a world champion shows you have what you need and you know you can achieve it.

"Once you do it once, you can do it again. It doesn't change my mindset but it makes me feel that I could actually do this rather than thinking it would be nice."

What the victory in Rome also gave her was time and space to plot her build-up to London. It meant she could withdraw from competition, allow time for recovery and then be able to attend two altitude training camps with the rest of the Great Britain squad at the Centre National d'Entrainement en Altitude (CNEA) at Font Romeu in France.

It is a base that has been used since 2001 by the GB squad and has proved successful, with a medal won at every Games since the sport was introduced in 2000 into the Olympic programme when Ayrshire's Steph Cook, the inspiration for Spence getting involved, took gold in Sydney.

The CNEA training centre is around 6000 feet above sea level, but the mountains are higher, and Spence had to endure punishing training runs at heights of 7000 feet.

"I don't know if I'm quite used to being world champion yet as it's all been hard work, hard work, hard work ever since," she said. "Maybe after the Olympics are over I'll get a chance to bask in it when I have some relaxing time. But it's been nice to shut ourselves off and just focus on the training.

"We're really lucky athletes to be in the situation where we're in the prime of our career and competing in an Olympic Games at home. There are so many athletes before us and after us who won't ever get that opportunity and it makes going to the Olympic Games more special. It's not going to happen for a long time afterwards and I feel very blessed. I'm ridiculously excited about it all."