My method is to paint them as if I were dressing them. I put the base colors on first, then do the face and other flesh areas, then the uniform, then the equipment... I do all the painting of the battle-rattle after separation, but before attachment, with touh-ups after they get put on and set. For painting the battle-rattle, I put some tape on a popsicle stick to hold them for painting. But I always remove everything from the sprue... It's not a hard and fast rule though, since sometimes I have to put stuff in place in order to fit it, like when I mount a rifle in a figure's hands... I have to paint the hands and rifle as a unit..
Most of my figures are kitbashed/heavily-modified (even if they work well right outta the box, like drivers and pilots), so there's a lot of putty-work to paint over as well... Leaving heads unattached is easy enough, but I say, "what the hell" and paint 'em in-place, since I have to fill in gaps necks and such with the putty...