I can't speak to whether you need yellow fever vaccine to enter El Salvador. However, IF it is required and IF you miss your onward flight, it will be no help to get the shot in El Salvador. It requires 8 to 10 days to take effect.
I've done a lot of research on yellow fever vaccine this past week due to upcoming travel. The vaccine that is approved by the FDA for use in the USA has been out of stock since mid 2017. A new factory is under construction. It will be fall 2018 before the vaccine is available again. The FDA has agreed to the very effective vaccine that is used in Europe to be used in the US. Only 250 locations are available for shots. There is a list on the CDC website, though it is tricky to find.
If you have ever had a yellow fever shot, the CDC has determined that it is good for your lifetime. It used to be that they recommended booster shots every 10 years. Studies have now been done that show this doesn't improve protection. The requirement for boosters was removed in 2016. Fortunately, we keep track of our vaccinations on World Health cards where I spotted record of our yellow fever vaccinations in 2004.
https://wwwnc.cdc.gov/travel/news-announcements/yellow-fever-vaccine-access
Also:
https://www.iamat.org/country/el-salvador/risk/yellow-fever
Validity of certificate
A Yellow Fever certificate is valid 10 days after vaccination.
The World Health Organization announced that as of 11 July 2016,
existing and new Yellow Fever vaccination certificates are valid for life. Countries can no longer require travellers to show proof of re-vaccination or a booster dose as a condition of entry. Travellers should note that this new regulation may not be honoured by all border authorities during the transition phase.