I paint on mag all of the time in my work (aircraft painting) so I think I have something to offer on this subject. Paint adhesion and corrosion prevention are really one and the same thing. Any metal corrodes. Some, like the 'light' metals, aluminum, mag beryllium, zinc, etc., corrode much more readily than other familiars like iron and copper. To get paint to stick really well to any metal, you have to stop the corrosion process. Otherwise your paint is riding on a layer of oxide which is constantly ablating away and falling off. This is done by passivating the metal with an ion exchange. Remember that metal is corroding all of the time. As soon as you make it bare, it is corroded a little tiny bit by exposure to the air. This is not such a big deal with iron and steel, but with aluminum, for instance, you get a few minutes of bare time after grinding or sandblasting where you can get pretty good adhesion without treatment. After that the paint won't stick. So not only do you have to get off all the corrosion, you have to keep the metal from re-oxidizing long enough to get it painted.
So then the procedure is to remove the new (invisible) corrosion, usually with an acid bath, then immediately apply a conversion treatment. For aluminum the standard product is something called Alodine 1201. It 'converts' the surface of clean, corrosion-free aluminum to an aluminum chromate substance, which does not corrode at all. Then the paint will stick like mad and no more corrosion happens.
There WAS a similar treatment system for mag from the same company, Henkel , Alodine 1001, but is no longer in their product catalog since Henkel took over the Alodine line from Parker Amchem. More recently I have been buying mine from Eldorado Chemical under the name Mag Kote. Quarts of Alodine 1201(for aluminum only) can stll be bought with the DuPont label from your local auto paint jobber as 226S. This is re-badged Alodine 1201 straight from Henkel. Unfortunately the mag version was never available in the DuPont label to my knowledge. Unfortunately again, Eldorado makes you buy 4 gallons minimum, which is more than you will ever need.
Mag is very sensitive to acids, so acid washing is usually not used. Either the freshly ground/sandblasted mag is treated immediately with the conversion treatment, or a mild alkaline wash is used. I successfully used plain ammonia detergent from the grocery store diluted about 3:1. Then the Mag Kote is applied by spray or dip.The treatment causes an immediate visible change in the surface color of the metal, which indicates that the treatment is effective.
Once treated, you can apply the primer/paint system of your choice. Zinc or strontium chromate/epoxy primers are best. I like the mil-p-23377 yellow primer. Without paint, the surface treatment is easily scratched off as it is only a few molecules thick. The treatment stops further corrosion and gets the paint to stick and the paint in turn protects the surface treatment fom damage.
All of this stuff is really toxic, containing several different toxic heavy metals and cyanide salts, so you should handle it carefully and follow directions.
Jimbo