Warwickshire, who collapsed to 17 for five with Hoffman, 35, who played four first-class games for his native Queensland in 2004, taking three quick wickets, and were bowled out for 113.
Indeed had Warwickshire's Scottish all-rounder, Dougie Brown, not struck a six and a four in his 23 not out, Warwickshire might have failed to reach three figures at all.
Former Zimbabwe captain Heath Streak then took four for 22 as Scotland struggled early on in reply but they were on target for victory when they lost six wickets for 18 runs.
That left Scotland, with their last pair at the wicket, still needing six runs for victory. But number 11 Hoffman became a hero with the bat when he launched pace bowler Neil Carter for six over extra-cover.
It was Scotland's first league win of the season and a memorable day for their coach Andy Moles, the former Warwickshire opening batsman.
"I am very pleased for the team," he told the BBC. "In the last two games we've made 250 and lost, and now we've managed to get a win."
"We've got to build up to the ICC Trophy (in Ireland in July) and winning tight games like this will make the boys stronger for the experience."