That’s the way to go. With the cost of new pu trucks so high, it’s more feasible to replace major items. I don’t know where you got a so called factory engine for $5k, but it sounds do good to be true.
I was fir ur in a rebuild would run $6k, new tranny and differential with driveshaft, shocks, and brakes would be around $14k. Buy a used truck for $15k and you should be good for 300k miles.
My truck is 1998 and uses the old Chevy 350CI small block engine. You can still get those engines from Chevy for about $4K. $1K to pull the old one, bolt on the manifolds and starter and install it. Like I said I have an excellent local mechanic who I trust.
No rust, the other running gear is good and we only use it for camping and odd jobs around town.