Jack Midson struck from the penalty spot with 18 minutes remaining after Andy Mangan had cancelled out Gary Alexander's header in a dramatic second half.
Victory lifted the Dons out of the relegation places and instead condemned Barnet, with whom Midson spent a spell on loan in 2011, to non-league football next season.
And Ardley, who took over as manager in October, insisted his side had got their reward for keeping the faith.
He said: "We said to the players 'it's in the script, we are staying up'.
"I said if we concede a goal and fall behind then I want every single player to think this is part of script and we will come back, and it seemed to work because every time we've gone behind we came back.
"That was against Exeter and Gillingham and that was here. They had something to believe in, after those games if they didn't believe in it then they never would. It worked and I'm really proud. I'm so glad it's all paid off.
"We had a plan, we knew that our season and our revival couldn't quite start until January because we had a lot of injuries and we felt the squad wasn't quite up to what it needed to be.
"We worked incredibly hard in January and I think we were brilliant in 2013. It shows the task and the catch up we had in hand and I'm so proud we got it all over the line."