centrifugal pumps don't build up internal pressure so why would it get damaged?
if you slowly close the valve it would actually run with less resistance as it doesn't have to redirect water flow anymore, since the water stays within the impeller cage, rotating along with the impeller.
if you were to slam the valve closed with high speed flow then the sudden stop of the water movement could probably cause damage to the impeller so don't do that
Most aquarium pumps are water cooled - the big worry with closing a valve on the output is that the pump will overheat and damage itself. This just isn't going to happen if you're just closing the valve, walking downstairs and unplugging the pump.
It is a worry if you close the valve, get distracted, and leave the pump running for a couple of hours (especially for external pumps that aren't fan-cooled - submersed pumps will take much longer to eat themselves).
I wouldn't worry about how fast you close the valve if you've got more than a couple feet of hose attached.