As an update I manged to solder it all together. Not sure if I made it too hot though as I was heating up the wire so that the solder melted when placed on the the wire. I think I was only supposed to heat the wire up a bit and then melt the solder on the soldering iron.
It managed to last the week before the actual sensor casing broke off (it was too also damaged from the chain) and the screws could no longer hold it in place. Halfords managed to get me the part next day (after initially telling me it could be a month) and a nice new one has been fitted. This time I've put loads of Gorilla tape over the wire and covered the sensor casing in loads of hot glue to protect it from the chain. I'll also fit a top chain guide.
Thanks for the help. It at least saved my commute for the week.
I'm pleased to hear that you are up and running again.
If even you need to solder 2 wires together again in the future the trick is to:
1. remove 10 to 20mm of insulation on each wire
2. twist the exposed wire together so that they wrap around each other by a couple of turns
3. let the soldering iron heat up enough to easily melt the solder and leave a layer of solder on the tip of the iron
4. place the tip against the twisted wires and place the solder against where the tip touches the wire
5. keep lightly pushing the solder against the joint as the solder melts and flows into the joint
6. depending on the size of the wire and soldering iron tip you might need to flow solder into the opposite side of the twisted wire, the goal is to get solder into all the exposed wire with a small amount of overflow on the outside of the joint
The ends of the plastic insulation might melt back a few mm but no further.