My squares tail light harness actually was similarly hacked.
If you want to fix it i would recommend pulling the harness off the truck (just plastic retainers that either open or pop out, undo the sockets from the tail lights, unscrew the ground from the bed on the driver side, and then unplug the harness from the trucks harness. , undo the license plate lights , pop all your bulbs out, then you should be able to pull the harness away. At that point you can bring it to your bench and repair it. all those taps have to come out, and youre gonna need to use heat shrink and something like solder-splices or just solder if you are able to do that. Cleaning the wires to see the original colors accurately does help.
But you can also buy the tail light harness new, and a later square has superior tail light sockets than the earlier ones like my truck. but you can use, to my understanding, any fleet side tail light harness if you want to shop used.
I would not recommend butt splices because they would all be in the same spot , near a plug, and thats going to bulk the harness, create a lot of weight, make guarding it for the future more difficult, and increase complexity for you to fix it.
But you can do it, I guess, just not advising it.