Colchester took a 23rd-minute lead when skipper Matt Heath stooped to head in Lloyd James’ floated pass from close range.
Dons goalkeeper David Martin denied Kayode Odejayi, who had raced through on goal, but the visitors turned things around in the final seven minutes of the first half.
Former Colchester loanee MacDonald prodded in Daniel Powell’s low cross from eight yards, following Dean Lewington’s throw and in first-half stoppage-time defender Tom Flanaghan controlled and fired in from close range after the U’s had failed to deal with Stephen Gleeson’s corner.
MacDonald tapped in his second of the game from Mark Beevers’ low cross with 16 minutes to go, following Ian Henderson’s misplaced pass.
Gleeson made it 4-1 with a long-range effort which eluded goalkeeper Ben Williams and Jabbo Ibehre tapped in substitute Dean Bowditch’s low cross in stoppage-time to complete the Dons’ big victory.