After watching a gas boat burn to the waterline at my marina recently, I remain more convinced than ever that gasoline and I don't mix.
But if you own a boat, and the engine needs replacing, it becomes a cost analysis.
A rebuilt A4 will cost you around 5K, not counting local yard fees for hauling engine out and reconnecting things.
A rebuilt 3GM30 would probably cost the same, with the same yard fees, but:
the 3GM will force a number of major modifications. The mounts will need to be relocated, possible requiring stringer mods.
The exhaust system will probably need complete replacement. Electrical system will need rewiring along with new gauges (price the yanmar instrument panel!), fuel system will need to be modified, Shaft may need to be pulled and cut or replaced. if you have to go to 1" add new prop, new cutlass bearing, new stuffing box. engine controls relocated, etc etc etc
Nothing that can't be done if 1) you have unlimited funds or 2) you have a lot of mechanical experience and time.
You might consider swapping in a used A4 in running condition to keep you in the water while you research the issues involved.