There is a concurrent thread on repowering a wooden GB 32 that may have some relevance to buying a Mainship 34 with an old Mitubishi engine and planning to immediately repower it.
The OP in that thread plans to keep it forever (well maybe his forever) so loss of market value with an expensive engine in a wooden boat isn't an issue for him, but maybe for you.
There is a lot of debate and alternatives discussed on that thread, but if you want an engine that will run "forever" and have service and parts available anywhere in the US, then a remanned Cummins 6BT 210 hp with a full factory warranty is the best bet IMO. That Cummins will cost about $20K, maybe another $3-4K for a transmission and $5-10,000 to get it installed by a yard. So the total is in the $30K range.
If you pay $20K for your boat you are looking at and add $30K to repower it, can you ever resell it for $50K? Probably not unless the hull, genset, electronics and everything else is pristine.
It is almost always better to buy the boat and the engine in the condition that you ultimately want and not spend the money on a "fixer upper".
David