I would replace the motor
but you will also need to replace the terminal
in the motor connector and possibly the connector
itself if you can't get the terminal out due to any melted/deformed part of the connector. There's a small tab on the terminal that holds it inside the connector body. You can use a jewelers screwdriver or similar to get in there and press on the tab while pulling on the wire to get it out. Then you would need to cut and strip the wire. If the wire strands are discolored, you will need to keep cutting back and stripping it til you find good wire. If the wire is no longer long enough to reach the connector, you would have to splice a new piece in. A special crimping tool
is required to install these terminals. Doing all this is very important or you will continue to have problems in the future. You must have a good clean connection. Also check the pump
for any signs of leakage. Is there rust on the motor shaft? Typically, the pump will leak where the motor shaft engages and water gets into the motor rusting up the shaft and bearings.