room you have in the engine compartment. Mine IS a 2GM20F and the fresh water cooling system makes for a pretty crowded engine compartment in our boat, certainly not enough room to wield a regular spray can. I replaced my old original Farryman one-lunger with this Yanmar, which I rebuilt and painted in our shop. Since it was nearly a four year restoration on the boat, I had plenty of time to work on the engine and clean/paint each part individually and then overcoat the completed engine with more color and then clear coat.
I have painted many engines in place and it can be done, but is never quite as satisfactory as doing the engine outside the boat. You can now buy the small spray cans of automotive paint in the exact Yanmar color and it is much better quality than the factory original paint. These small cans are a bit more conducive to tight quarters. I generally start by degreasing the engine (Simple Green) works best with the easiest clean up of the bilge. Then one can get as much of the flaking rust off as possible using the small stainless steel brushes available at the hardware store - at that point I generally spot spray the worst areas with a good "rust converter" and then primer over that with the same brand of auto primer (still in the small cans) and finally lay on the final color coats following up with same brand clear coat. This type paint drys quickly and you can put on three or four coats in a single day (I would want at least three light coats for blending and durability). Mask off any areas you don't want paint on and swaddle the bilge with an old sheet. If you are spraying inside the boat be sure and wear a good mask (not just a dust mask) and come up for fresh air often. It helps to have a fan exhausting the fumes out of a open locker or hatch.
It's a lot of work to keep an engine pristine, but the longevity of these little Yanmars make it worth it over the long hual.