Sampson, who had been in temporary charge since Stuart Gray's departure, was given the job until the end of the season on Monday and saw his side clinch a place in the Johnstone's Paint Trophy quarter-finals thanks to Ryan Gilligan's stoppage-time penalty.
Gilligan had earlier provided the 66th-minute free-kick for Steve Guinan to cancel out Danny Hollands' 33rd-minute opener but it looked as though Bournemouth would win the tie in the 88th minute.
However, goalkeeper Chris Dunn saved Lee Bradbury's penalty and two minutes into stoppage-time Gilligan grabbed the winner from the spot.
"I was delighted to get everything sorted out but felt confident it would be," said Sampson. "It wasn't the greatest of games but the result was all important for us.
"I didn't have to say much to the players at half-time, I just suggested we pass the ball to our own players! We improved dramatically in the second half and it's just nice to be in the next round."