The answer, as with most things, it that 'it depends..' If your flight arrives from Santiago on time, and if baggage delivery is reasonably prompt, you should have no problems.
Your first flight is domestic, so, aside from the customary aviation security pre-flight, once you are off the plane at Madrid, you proceed directly to baggage claim. Terminal 4 is HUGE, so I suggest no dawdling or shopping en route, outlets only. Do that stuff at Terminal 1 AFTER you go through pre-flight security there...
Shortly after baggage reclaim, you are in the main, landside terminal, and a short distance to the curb and the free inter-terminal shuttle buses. Here is the web page for terminal to terminal transfers at Barajas:
http://www.aena.es/en/madrid-barajas-airport/transport-between-terminals.html
The table in the web page says the travel time form T4 arrivals to T1 departures is 15 minutes. Madrid Barajas is a very, very big airport and the terminals are spread out. But the scenery is great. That travel time is in addition to waiting for the bus. The buses run every 5 minutes. So, it should be no more than a 5 - 10 minute wait for the next T4 to T1 shuttle, and then 15 minutes to T1.
So, the bottom line is that, if there are no system delays beyond your control, and you move with alacrity through the terminal to get to T1, you should be fine.
Hope this helps.
P.S. This is why I try to stay only on the One World Alliance codeshare flights: AA, BA, IB... They all come into and fly out of T4 at Barajas. It avoids the need to changes terminals. Baggage is moved automatically, in both directions. I only need to get ME to the next departure gate. Just sayin...