The highly-regarded then 26-year-old had become disillusioned with life at Villa Park and looked to be on his way from the club.
Pompey were big favourites to land the left-sided player, but O’Neill talked him out of the move and convinced him to sign a new four-year deal.
Barry went on to have a flying season, scoring nine times and winning praise for his displays – before moving to Manchester City for £12m in the summer of 2009.
O’Neill admitted his team would have faced a campaign of struggle had they lost Barry to the Blues.
He said: ‘I don’t think we could have known at the time just how important it was to keep hold of Gareth Barry.
‘But considering that we were able to make only one signing at that time, I genuinely have no idea where we would have been if he had left.
‘It would have been a very long season and our problems certainly wouldn’t have started in October.
‘He’s been immense, absolutely immense for us ‘How close was he to moving? 'I think you’d have to ask him that. It’s very, very difficult to keep hold of a player who is unhappy.
‘I think he was a bit disillusioned by events, but I’m very pleased he decided to stay.
'He’s been terrific – better than I could ever have imagined.
‘It wouldn’t have mattered if we’d got some money for him, because we wouldn’t have been able to have replaced him.’
In the summer of 2006, Redknapp brought in midfielders Niko Kranjcar (£3.5m), David Thompson (Free) and Jean-Francois Christophe (Free).
As Villa finished that season in 11th position, the Blues finished four points higher up in ninth (54 points).