Fixing/replacing rim/wheel with Internal Gear Hubs (Nexus 3)
I don't think you're going to be able to swap the guts of an internally geared hub on to a prebuilt wheel that doesn't have the same hub on it to start.

If you buy a new rim, you should be able to do a rim swap relatively easy if you have a truing stand.  Simply tape the rims together and swap the spokes over to the new rim one at a time.  Then you'll need to re-tension the wheel from scratch, but you won't have to worry about re-lacing the wheel.  If you're not comfortable with this process, you may want to take it to a bike shop and have them rebuild the wheel for you.

Here's an overview on how to do a rim swap in more detail.
http://www.crazyguyonabike.com/doc/?doc_id=4888