Couple of years ago I put together a spreadsheet adding up the costs of a hemi swap versus a rebuild of my numbers matching 360. In the end, a rebuild of my 360 with better compression, a set of Edelbrock heads, a roller cam and Megasquirt EFI (w/ a fuel system) was looking to cost me $6,600. If I bought a truck 5.7, plus all the parts to swap it in (including the EFI fuel system), with cast iron manifolds, a Hot Wire Auto harness and ECU, car timing cover, water pump and intake, plus whatever miscellaneous stuff I could remember, it came to $5300. The difference was big enough that I could have done TTI headers and a new cam, and still been cheaper than rebuilding the 360 and adding EFI.
I also looked at just swapping a roller cam, Edelbrock heads and EFI onto my current shorblock, and that total came to $5600. Even just a better carb with the roller cam and Edelbrock heads was $2950. That was just if I wanted to try and keep up performance wise.
Best I could get the Hemi down to was $4050 with an OE harness I modified and a B&G flash to the ECU, and the rest of it being truck parts. That was about the same as rebuilding the 360, adding Edelbrock heads and a roller cam, but no EFI.
I would say that if you have to rebuild a Magnum (or want to build a 408), the G3 starts looking more cost effective, if you can find one that isnt broke.
If either one is going to need a rebuild, the Magnum might be more cost effective.
Those numbers don't directly correlate with a 5.9 rebuild, though, as that included some costly lifters for the roller cam. But even if I saved $500 by using a Magnum block, and bought EQ heads instead of Edelbrocks, I'm not sure it would pencil out.