I think the law is pretty vague about this. It's definitely illegal if you do it to defraud the wireless provider or try to gain ESN of someone else. If you swap ESNs on your own devices I don't think it's as clear. I think even if a lawyer thought of a way to prosecute it, the technical aspect is not fully covered in written law.
I really considered doing the ESN swap, but I just figured it was too much trouble for little return and bought two new devices.