For the most original ride quality, go with the Sachs. No sense in spending the extra money on the genuine BMW struts, they're literally the same thing. If you're looking for an upgrade, I highly recommend Koni struts. I don't have them on the BMW, but I have their STR.T struts in my V70R and I'm really happy with the ride. Firmer than stock, but not too harsh.
As far as the suspension code, I'm not totally sure about the differences between them. The struts are likely similar enough that you'd never know the difference, but I can't say for sure.
1999 528iT Sport M52TUB28- 2-2-1999 240k+ miles
2004 X3 2.5i- M54B30 swapped
2006 330i N52B30
2000 Volvo V70R Manual swapped, daily driver
1991 Volvo 944 Turbo
1992 Volvo 245