Vale had led until the 90th minute thanks to Tom Pope's 21st goal of the season but visiting boss Micky Adams was to endure a miserable return to Bramall Lane, 18 months after his sacking.
Vale's Clayton McDonald was fortunate not to turn the ball into his own net early on when he diverted Chris Porter's low cross straight at goalkeeper Chris Neal.
The dangerous Pope put Ben Williamson through on goal but George Long did well to block with his legs.
Yet Pope made no mistake himself as he put the visitors in front after 33 minutes, firing low past Long after receiving the ball from Jennison Myrie-Williams.
The hosts started brightly after the break and only a superb save from Neal, down low to his left, prevented Porter's header from finding the net.
Miller wasted a golden opportunity, missing the target from close range with a downward header from Nick Blackman's cross.
But he atoned with a 90th-minute equaliser after getting on to the end of a deep ball from Ryan Flynn, before then pouncing for the winner in the fourth minute of stoppage time after Flynn's shot had been parried.