Just fix whats wrong with it, don't dork it up with switched power and such. You don't need to do anything while replacing the pump other than verify that the connections on top of the tank are sound and the wires good (not cracked, etc.). I would suspect if replacing the pump does not fix the problem, that the wire from the back to the front may be frayed/chafed.
Do the pump, then before even putting the tank back, check every wire associated with operating the pump. The computer feeds the relay coil, other side of coil is prob to Ign, relay has +12 on one side and output +12 to pump on the other. Intermittents are tough to find, but walking through the whole thing will at least let you know all is visually well.