Changing the cassette only affects your human-powered portion of the drive. That's assuming you're replacing your hub drive motor with another hub drive motor. So, whether it is worth changing the cassette depends on how hard you pedal to get up the hill. If you're like me (relying on the motor to do 80% of the work), the gain might be insignificant. If you're in better physical shape and provide more of the "oomph" power, the gain could be worthwhile. The more you put in, the more you get out.
If I were you, I'd do it for precisely the reason you stated ... because you might as well do it since you've already removed the old freewheel cassette.