Just clean the engine off before you begin. Then when it's dry, blow it off with compressed air.
Thereafter, just be surgical about your management of contamination getting into the area being repaired, then you should be OK.
I'm a little OCD, so if it were me, I'd wait till I was just about ready for an oil change before I started the work. Then I'd do one afterwards. My engine on the other hand would likely be indifferent if I was diligent about cleanliness before and during the repair.