Playing an opponent ranked 171st in the world, the British world number four needed almost three hours to complete a 7-6, 6-7, 6-4 second-round win.
Moodie, demonstrating a similar style of serve and volley to Henman's and outgunning his opponent by 24 aces to 11, gave the 2004 US and French Open semi-finalist plenty to think about.
After the first two sets had gone with serve it looked as if the third would also end in a tiebreak.
But in the 36th game of the match, Henman found himself with three match points, converting the third to seal victory.
"It's tough when you've got a guy serving that big and consistently," the Briton said. "It just emphasises how much you need to hold your own serve because a single lapse of concentration or a few bad shots could cost you the set.
"I did tell myself a couple of times that I just had to stick at it, and that I was the better player. It's hard to keep believing when you get aced 24 times."
IMPRESSIVE RECORD
Though it took him longer than expected, Thursday's triumph maintained Henman's impressive record in Basel.
A winner here in 1998 and 2001, the 30-year-old has made it through to at least the quarter-finals for eight years in a row.
Looking to gain valuable qualifying points for next month's lucrative Masters Cup finale in Houston, Henman will now face Czech world number 21 Jiri Novak in the last eight.
The match offers Henman the chance to take revenge for his straight sets defeat to Novak at the Athens Olympics.
"I'd like to think I can't play much worse (than at the Olympics)," Henman said. "Novak's a top class player though. There won't be many secrets between us."
Novak got a free ride into the quarter-finals after Spanish fifth seed Tommy Robredo was forced out of the tournament with a shoulder injury.
Argentine third seed and French Open champion Gaston Gaudio also made an early exit on Thursday, losing 6-1, 1-6, 6-3 to Austrian world number 92 Stefan Koubek, a result that leaves Henman as the only seed in his half of the draw.
Gaudio's compatriot David Nalbandian fared a good deal better in the top half. The fourth seed, who is also chasing a Masters Cup spot, saw off American Vincent Spadea 6-4, 6-4.
More from rediff