In terms of hard product, IB 330 = IB 340, AA 772 > IB 330 > AA 767, AA 321T >>> E75. As you say the wifi on Iberia is virtually unusable.
The soft product can be a toss up between the two.
Total travel time is approx equal between 1&2, but as you pointed out the duration of LAX-MAD would allow for a better overnight rest. Connecting in JFK is probably less painful than LAX.
Personally I would go w/ option 1, primarily for the $800 savings and better hard product.