Replacing chevy cobalt engine

Get a replacement engine, and swap the original wiring harness to the new engine, fixing the damage as you go. (I’m assuming this is a repair-only swap and not a “as long as I’m repairing it I may as well make it faster” swap)

Two reasons you always want to do this if you can: First, it eliminates a lot of guesswork if the new engine won’t fire - you KNOW the harness is good because it was just working 5 hours ago when you drove the car into the garage. Second, it keeps the connectors the same between the engine and the rest of the car - sometimes manufacturers will go with a different connector in different years, which means the new harness might not mate up to your old car. Swapping harnesses eliminates this.