The replay win set Rose up for a trip to Ballingry Rovers in the next round.
Miller said: "The players have worked their socks off to play like they did on Saturday and I'm really pleased for them. St Andrews showed they are a very good side
and we had to be at our best to win this one. That's 14 games played under my charge and only two lost, that's the response I wanted from the players."
Early exchanges showed both sides looking for an early goal to settle any nerves with plenty of chances created.
However, it was the visitors from Fife who drew first blood. In the seventh minute they scored a simple goal. Winger Allan Ramsey crossed from the right wing to Paul Farquharson at the back post and his looping header found the net at the front post.
In the 15th minute Bonnyrigg equalised. Following a spell of pressure, James Morrice's shot was blocked but fell to Graeme McCaul 15 yards out. His effort was palmed by the keeper but rolled over the line at the far post.
Bonnyrigg took the lead for the first time in the game just after the half-hour mark.
A great run by Sean Paliczka caused panic in the St Andrews defence. The ball bounced about before falling to Morrice, who blasted the ball into the net.
The lead lasted only four minutes in to the second half as St Andrews drew level. A poor clearance from the Bonnyrigg defence was picked up by David Evans who laid the ball off to Paul Farquharson and he wasted no time in drilling the ball home for his second of the match.
There was a spell then when any side could have taken the lead again. Chances were again being created and missed on a regular basis, until a nice piece of magic from Paddy Flannery in the 72nd minute.
The ball was played into him through the centre and he simply flicked it on to David Burrell who was breaking through the heart of the defence. He ran on and scored easily to put Bonnyrigg in front again.
The scoring wasn't finished yet. There was still time for another goal and it fell to Bonnyrigg to put the game beyond doubt.
Paliczka , a thorn in the Fife side all afternoon, went on another good run into the box and this time he was brought down for a penalty. Full back Ross Hamilton stepped up to drive the ball home and finish the scoring in the 80th minute.
St Andrews tried hard to get back into the game but Bonnyrigg were in no mood to let them and in the end it was a hard fought victory for Alan Miller's men and a win which kept the crowd happy.
St Andrews boss Jim Hardie was disappointed but honest enough to say: "Bonnyrigg deserved to win this game. Their third goal punished us because we thought it was offside. But you play to the whistle and they took their chances.
"To come here and play as big a side as Bonnyrigg and play like we did gives us a good idea of how we would stand in the Super League. Both sides played good football and we congratulate Bonnyrigg and have no complaints."
Rose manager Miller added: We knew after last week that the tie was far from over. They played some good football and have some terrific players. But we stuck to our game plan and it worked. Our midfield were an inspiration with goals coming from that area.
"The players have put in a tremendous amount of hard work since I came here and they are getting the rewards for it. A place in the third round was on offer and they took it. There are problems at the club the same as any Junior club around, but the players have put that to the back of their minds and are getting on with their game. That showed on Saturday.
"The crowd were behind us and gave us a lot of support and we hope we left them happy."
Bonnyrigg Rose: Coyle, Campbell, Hamilton, Reid, Ritchie, Thomson (Walker), Morrice (Brigain), Burrell, Flannery , McCaul (Bracks), Paliczka. Subs: Lumsden, Killin.
St Andrews: Davidson, Maiken, Suttie (Brash), Fraser, McInroy, Herkes, Ramsey (McGuigan), Patrick, Evans, Sutherland, Farquharson. Subs: Finlay, Malone, Traynor.
The full article contains 765 words and appears in Edinburgh Evening News newspaper.