In idha tatayyaba al-muhrim, idha introduces a condition, tatayyaba is a past verb, and al-muhrim is the subject. In fa-ʿalayhi damun, the prepositional phrase forms the fronted predicate and damun the postponed subject.
Wa-in halaqa uses the conditional particle in. Repeated conditional structures help the learner separate the factual trigger from its prescribed consequence.