Earlier, the defending champion, from Garioch AC in Aberdeenshire, trailed Canadian rival Emily Overholt in the opening stages of the first heat of the competition at Tollcross Park, but soon reined her in and finished strongly in 4mins 38.27secs, just over half a second quicker than the time that won her gold in Delhi four years ago.
It was a second straight Commonwealth gold in the discipline for Miley, who took her emotional state into her media duties.
"I'm absolutely knackered. I don't need a swim down because I feel quite light-headed at the moment! I've got so much lactic acid building up," she said.
"Oh my God, that was just incredible. I literally couldn't feel my legs for the last 50 so, when I touched the wall, I was hoping and praying that I could go fast."
Miley lost out to Willmott when the pair last met in January and some had fancied a repeat of that. But Miley ultimately had confidence in her methods, if even if she did ask herself some searching questions along the way. "I've had my scalp taken a couple of times and I've had to stop and take stock, ask: 'Is it really working? Am I going in the right direction? Do I need to move?'" Miley added.
"But I totally trust the work that my Dad has done. "I've also had to really take ownership of my sport, focus on what I needed to improve, research everything from nutrition to land exercises, work in the water. It has just all worked - thankfully.
"It's not just a young person's sport any more, it's anybody's game - it's just if you've got the heart and soul to fight for it."
Aimee Willmott of England, Miley's greatest rival for gold in this evening's final, won the second and final heat in 4:39.50.
Stephen Milne then kept the momentum going by delighting the home crowd with victory in his 400m freestyle heat. Daniel Wallace and Robbie Renwick completed a remarkable Scottish 1-2-3 and all three were fast enough to comfortably qualify for tonight's final.
Milne's time was a new personal best of 3:46.88 and the eighth-fastest time in the world this year.
Caitlin McClatchey, however, was muscled out of contention in the 200m freestyle. The 2006 champion also saw her Games record from Melbourne beaten by three different swimmers as she failed to reach the final.
Corrie Scott set a new Scottish record of 30.64 to reach the 50m breaststroke final, where she will be joined by fellow Scot Kathryn Johnstone