Fa-in connects a new condition: fa- links it and in means 'if.' Kāna saʿā describes earlier performance of saʿi. Bayna al-ṣafā wa-l-marwah names the place through an adverbial/idafah construction.
In lam yarmul, lam negates and makes the imperfect verb jussive. In wa-lā saʿya ʿalayhi, lā of categorical negation takes saʿya as its noun and ʿalayhi supplies the predicate sense: no saʿi is due from him.