Best time is right after the block has been cleaned, crack checked, all machining completed and oilways flushed.
This is the best time to get best paint adhesion, and avoid the chances of getting damaged if it were done earlier. Once you start greasing bearings etc during assembly you may accidentally get grease on the block, which obviously affects paint application.
You can also do this when all the heads etc are on (assuming they will be the same colour). This is the approach recon engine suppliers adopt.
I've always uded engine enamel when painting myself, as its oil/petrol proof, can stand high temperatures, and doesn't flake off. I brought it from my local parts supplier, so it must be available from the likes of Halfords, etc. Others use etch primer and standard 2-pac or celulose. I have no idea what my engine builder has used this time around.