You could either ask Randall Munroe that question (xkcd), or just do the thought experiment yourself.
Since energy can neither be created nor destroyed, for each J of energy you put into Mars from Earth, you take away from Earth. Net effect would be that Mars would have a magnetic field, but Earth doesn't. Except of course, that Mars has a much smaller mass, and Earth probably has energy to spare.
It still sounds like it would just be cheaper to fix the social problems here on Earth and build an orbiting transparent Dyson-trampoline to deflect any incoming killer asteroids.