Choices and Options
Per your bio here you have an E-27.
I have a friend that made this same upgrade many years ago when his original A4 died.
He installed a Yanmar one cylinder, which looked rather petite in the engine bay.
:0
He said later, after bucking head seas for a day going up the Washington coast, that he really should have put in the twin, and had the advantage of 12 or 14 hp rather than 9.
It reached hull speed with no problem in smooth water, but lacked oomph for head seas and head winds.
In your situation, if you are tempted by a used diesel, try and find a twin cylinder from Yanmar or Universal -- there are often some for sale as folks move up to larger engines in their older 30 foot boats. OTOH, one of the reasons that sailors replace those old diesels is that their engines need a full rebuild, and are... in fact... OLD...
It's a many faceted problem. You will also need to change out engine controls and quite likely the fuel tank.
Best chance for success if you know a good mechanic or shop that you can trust to help you find and carefully vet a replacement engine.
Or just write the check for a new Betamarine with a (Gasp) warranty ......
Anyhow, keep us posted and best of luck to you.
Loren