Correctly scaling FFT of different lengths
Currently, I find my impulse response by performing an FFT of size 32k
  on my entire measurement signal, and my reference signal. I divide
  each by the scaling factor 1/sqrt(M) 


Scaling here is unnecessary since you are going to divide the two spectra anyway. Any scale factor will cancel out.


  I then divide the two signals, and perform an inverse FFT, and then scale by dividing by sqrt(M).


Scaling here is wrong. Dividing the spectra creates a transfer function and the impulse response is simply the inverse FFT of the transfer function, regardless of FFT size (unless it creates time domain aliasing)


  I then once again perform an FFT on each window, and again scale with the 1/sqrt(M).


Wrong again. Don't scale FFTs for Transfer/Function&lt;->Impulse response relationships


  And then get my magnitudes using: i = sqrt (re/im) mag = 20 * log10(i/M)


This makes no sense to me. You seem to divide the real part by the imaginary part. That could potentially be part of a phase calculation but has nothing to do with the magnitude. If you have $H(\omega) = a+ j \cdot b$ then your level in dB is simply $L(\omega) = 10 \cdot log_{10}(a^2+b^2)$


  I am pretty certain that the issue is to do with having not used any scaling factors for my windows used.


This has nothing to do with the windows. Stop scaling anything at all, and this should just work.