I would still replace it. If the wires are exposed near the spark coils, then it is shorting out and probably causing your fault code(s).
I don't believe there is any way to fix it. Some may have tried, but I believe it is a band-aid approach that won't last.
You may (or may not) continue to get fault codes and you'll never know whether or not the codes are true or not untill you replace the harness.
2001 E430, Bourdeaux Red, Oyster interior.
1973 280SE 4.5, 170,000 miles. 568 Signal Red, Black MB Tex. "The Red Baron".