I emailed them a couple of days ago and this is what they said:
We do not have a general policy on resits at St Andrews. We operate a contextual admissions process, which means that we will consider your qualifications in the context in which they were attained. It is worth noting, however, that generally resits or results over two sittings may make an application less competitive.