score:2
It is tight but within the legal minimum connection time, provided both flights from Terminal 4 and the code-share qualifies for Iberia-Iberia connection. See https://www.iberia.com/us/fly-with-iberia/madrid-airport/connectiontime/
Since it is a single ticket, the airline will cover you and put you on the next available flight for free. In this case, this may only be the next day.
While you have a good chance of making it, there is a non-trivial risk, you'll miss it. Even if there is no financial impact, you need to decide whether you are ok with potentially loosing a day at your destination and dealing with a re-book, logistics, and haggling with unhappy gate agents around mid-night