Get a new gasket, they aren't expensive.
Remove valve cover (and I cannot help much here, I don't remember what an M104 valve cover looks like!). If there are holes in it for the spark plugs on top, there will be gaskets for those as well, like on the old M110 engine. Probably four or six 10 mm bolts, maybe 8 if it is similar to the M103. The plug wires are in a plastic tray -- on the M103 you can pull the tray off and leave the wires in it. Don't know on the M104.
Remove all old gaskets -- they fit over the edge -- and make sure the cover is clean where the gasket fits. Wipe the head where the gasket will do down with some solvent -- it must be clean and dry, no oil or dirt.
Fit gasket to cover, no sealant. It should stay in place if pressed on.
Fit cover back onto the engine. Make sure the gasket is still in place with no sections rolled under anywhere. Lift cover and thump down onto the head firmly, repeating until it goes "CLOP" instead of "THUMP". This ensures that the gasket is seated all round. You'll hear the difference. Re-install the bolts and tighten with your hand around the head of the ratchet, not on the handle. That way you won't overtighten.
I'd think the oil wouldn't make much difference on the spark unless the boot were bad already, but if it's been there a long time, it may cause the rubber to deteriorate.
1972 220D ?? miles
1988 300E 200,012
1987 300D Turbo killed 9/25/07, 275,000 miles
1985 Volvo 740 GLE Turobodiesel 218,000
1972 280 SE 4.5 165, 000 - It runs!