The First Division club refused to give up without a fight and took the lead through substitute Daniel McBreen in extra time, before a penalty from Nacho Novo saw the clash decided by penalties.
Neil Alexander, deputising for the injured Allan Mc
Gregor in the Rangers goal, saved penalties from Steven Milne and Jody Morris, with Brahim Hemdani also failing to convert from the spot to ensure a tense finale.
Fellow SPL side Aberdeen crashed out at the same stage of the competition to another First Division side, Queen of the South, last week, and Smith admits his players were fortunate not to suffer a similar fate at Hampden yesterday.
"We managed to get there but it wasn't the best of days for us in terms of our overall performance," he said.
"St Johnstone worked very hard and made it very difficult for us. Derek (McInnes) can be proud of his boys and they deserve a pat on the back for the amount of effort they put into the game.
"We have played better in other games so we are delighted – and a little bit relieved – to get through to the final."
Rangers may have been favourites to win the entire tournament ahead of kick-off but Saints ensured their progression to the final on May 24 was by no means a foregone conclusion.
Novo missed the best opportunity but St Johnstone had chances to end the tie during the regulation 90 minutes.
"We had to put a great deal of effort into the game just to match St Johnstone, never mind anything else," added Smith.
"We had a few opportunities that we managed to squander and, overall, the performance wasn't a good one but the result was."
Rangers continue their chase of four trophies and, despite losing Chris Burke and Steven Naismith to injury early on, Smith is confident the clash will not have too detrimental an effect on a club with plenty of fixtures to fulfil.
Smith made eight changes from the side that lost to Celtic in midweek. "Most of the players who played haven't played an awful lot of games," he said. "But sometimes when you make a lot of changes, it's awkward to get them going."
In contrast, Saints boss McInnes admits 120 minutes of football and a penalty shoot-out was just too much for his brave players. "Extra-time just caught up with us a wee bit," he said.
"But I know my players will get a lot of credit and they should because they brought so much to the game. My disappointment is for the players because they are hurting and I feel for them."
Morris, back from injury, was one of the players clearly struggling at the end but, of his penalty, McInnes insisted: "He felt fine to take it. We practised our penalties in training this week and Jody didn't miss one.
"I know you can't allow for a match situation and the enormity of it but Jody's as clean a strike of the ball as you will get and he felt okay to take one.
"He is a senior player as well and he deserves credit. He had the character to keep pushing himself on when he was struggling and everyone could see that."
McInnes conceded the winning mentality of his former club told in the end.
"Rangers showed why they are still challenging on all fronts," he said. "They showed why they will probably win the league, why they might get to a UEFA Cup final.
"They've got that winning mentality."
Saints' Liam Craig described St Johnstone's penalty shoot-out defeat as "the worst feeling I've ever had in football".
"I don't think words can describe how we're feeling after coming so close against a team as big as Rangers," Craig admitted. "I thought we'd win because there was a real buzz about training and the manager (Derek McInnes), who has been here and done it with Rangers, had us mentally right and had us believing we could win it."
The full article contains 720 words and appears in Edinburgh Evening News newspaper.