Does the iPhone 5s have any built in water protection mechanisms?
To specifically answer your question, the iPhone (6 and lower)* does not have any specific water protection built in. In fact, there are "sensors" that will turn red (from white) if the phone has been exposed to water. One of them is inside the headphone port and I believe there is another one but don't remember where. 

Some generations of iPhone survive better than other by more or less accident and some of it has to do with your exact situation. It sounds like you were fortunate. 

Due to the severity of the incident, I wouldn't be surprised if the phone does die at some time within the next 1.5 years. However, considering it appears to work almost like-new (aside from the screen), your chances of making the contract are still decent. 

* the iPhone 6S is actually somewhat water resistant even though Apple didn't advertise it as such.