Hurst played 494 times for the Millers over 15 years and his first meeting against them seemed destined to be a draw after Jon Nolan's early goal had been cancelled out for Rotherham by Richie Towell.
The Shrews, who were playing with 10 men following Abu Ogogo's 53rd-minute dismissal, had other ideas, though, and gave Hurst an afternoon to remember when Stefan Payne slammed home deep into added time.
By the time Nolan drilled home across goal after sneaking through the home defence, Shrews goalkeeper Dean Henderson had already saved a penalty from English football's top scorer Kieffer Moore, who was unable to add to his tally of 13 goals.
The Shrews should have doubled their lead soon after the restart but Nolan blazed over from 12 yards before the task got much harder as Ogogo saw red for a poor tackle on Shaun Cummings.
The Millers found a way back into the game in the 76th minute and levelled when Towell was on hand to fire home from 18 yards after a loose ball fell perfectly for him.
Paul Warne's men looked as if they would go on and win it, but it was Shrewsbury who took the three points when Payne converted from close range.