It looked as if the Railwaymen had not read the script as the hosts started better and Uche Ikpeazu saw his goal-bound effort well saved by Carl Ikeme after 10 minutes.
Wanderers grew into the clash and soon fashioned the game's best chance through Michael Jacobs, whose curling effort had to be tipped past the post by Ben Garrett to preserve parity.
Jackett's troops found the breakthrough in timely fashion as McDonald fired them ahead moments before the interval.
Unsavoury scenes broke out shortly after the half-time whistle as Aneke appeared to elbow defender Richard Stearman, resulting in a brief melee between both teams and a straight red card for the Arsenal loanee.
In spite of the numerical advantage, the visitors nearly found themselves being pegged back as Bradden Inman spurned an excellent chance for the Alex, before the West Midlands outfit took a giant step toward promotion moments later.
Edwards received possession inside the area before firing a half-volley past Garrett on 66 minutes.
Ikeme was forced into action later in the half to deny Billy Waters and Mathias Pogba respectively, but the League One leaders held on to seal their passage from the third tier of English football.