Thanks for all the replies.
I removed the VSS (vehicle speed sensor) plug assemby and spayed it with
electrical contact lubricant and cleaner, then reassembled it. I also did
the same with the multi-pin plug above near the gearbox that this wiring
goes through. Touch wood, all seems to be OK now.