Magnetometer MicroMag 3 on Arduino Due

All those delays in the bit-bashing should be 1 microsecond, not 2 milliseconds - the chip
can clock upto 1MHz.

MEMS magnetometers are noisy, you need lots of low-pass filtering to
get anything reasonably stable. Try a cut-off frequency of 0.3 Hz or so at
first. That means sample at the nyquist rate for the device and digitally
filter the result.