Work your way up with the magnesium, if you take a lot right off the bat, well, you've already found out what happens. Start with 200mg/day, let your body adjust to that for a while, then add in some more.
As for water retention, salt may or may not be the cause or make it worse. I've been dealing with full-body edema for over a year now (poking my shin/ankle like described above leaves a lovely indent and white spot for several seconds) and my naturopath advised me both to not overdo it with drinking water and to use salt liberally.
I don't know that I'd worry about it if I were you...sodium is very vital in the body and if you're craving it as much as you are, there's a reason for that.