Short Answer: Before.
Although floors can be covered pretty simply during painting, the use of ladders and paint itself, could all potentially cause damage to a wooden floor. With this in mind, our recommendation is to paint your walls before spending money on wooden floor sanding and finishing.
Any minor damage or spills affecting your floors can be rectified by the team at Restore Floor Sanders during the floor sanding process however, trying to do so after can be a very tricky process.