yes, the capacitor helps with the operation of the decoder ...
and yes, join the two ends together, solder, and shrink tube, the wire length is not very critical
If the wire goes to one of those little insulation displacement connectors, I have just pulled the wire out and pressed in a new piece. I made a little tool with a piece of brass rod and a file to fit between the metal bits that hold the wire. You might have to pull the shrink wrap back a little to get to the connector. Or like the others said, if you have enough left, just solder it back together.
I made a repair to the wire harness this afternoon. There was just enough of the Black wire that I could use a fine needle nose pliers to pull the wire out of the plastic housing along with the small metal connector pin. I remove the unused Yellow wire and re-installed it into the plastic housing and then soldered the Yellow wire on the the tail of the black.
There wasn't enough of the Black wire to do any soldering to make a repair.