The interplay between GUT and flavour symmetries in a Pati-Salam × S4 model