Depends - if you have aluminum heads, oil pan that stays unpainted, intake that stays unpainted, etc. then before, while it is apart makes sense to me. Take a piece of plywood or a cardboard box and drill/punch holes for all of the bolts, then paint them all at once. Mask all machined surfaces, plug all holes, degrease thoroughly, prime and paint. If it's all going to be painted like OEM then after is probably easier. Either way it's a good time to grind down any flashing and other casting roughness before you clean it up for color. My opinion, and you may get other ideas.

Welcome to CHR, by the way! Post some pictures of what you're working on when you have a chance.