Let the buyer beware. The responsibility to check a used car when buying it is ultimately yours. In my opinion, it is likely that the dealer did not know the non-stock parts were there.
When I trade my cars into the Ford dealer, the first question from the dealer is typically, "Are there any modifications made to the car?" Modified cars do not sell well, so dealers want them to be stock.
I think the key issue here isnt whether warranty covers aftermarket parts or not, or if the original dealer know or didnt know there was aftermarket modifications to the harness but the fact that the second dealer went ahead and performed customer pay work that apparently wasnt authorized as the OP brought the car in believing it was covered under warranty. This is the key issue of the whole story and the fulcrum on which everything rests.
2011 Mustang GT M6 3.31s
Matt HONEYCUTT Tune, Lethal Off-Road X, GT500 axlebacks, J&M LCAs, UPR UCA, Whiteline LCA relocation brackets, Eibach Pro-Kit Springs, Koni STR.T shocks/struts, GT500 strut mounts, SR Strut Tower Brace
Best 1/4 E/T (05/18/14 MIR - no tune, X-pipe, or UCA): 12.920 @ 109.40 mph (2.059 60ft)