The original and therefore the proper way is to paint the engine in the assembled state. This ensures that the gasket mating surfaces have no paint and that the gasket edges do have paint. This also ensures that there will be no chipping of paint caused by lockwashers during the installation of the fasteners holding on the sheet metal parts etc. Its also hard to install painted fasteners without chipping them.
Paint on the edges of cork and thick fiber gaskets is good since it reduces oil seepage through the gasket material
Nice. This is what I was getting at.