I'm not sure where the information was from, but I'd be suprised that your VIE flight is departing from T4S. A quick search and all VIE flights operated by Iberia are from T4 currently.
You'll have to arrive at T4S, go through passport control, jump on the train to T4, head to the baggage, head to check in and pass security.
As others have suggest, certainly would feel better with a 4+hr wait providing all your flights are on time. Even the taxi journey to your gate can be a good few minutes at Madrid.