if you insist on reading the rulebook to understand right of way, the relevant section here is the one on stop hits, which are defined to be synonymous with counterattacks and must arrive before the opponent begins their final action. Refs nowadays define any forward motion with searches and suchlike to be a compound attack, and are very lenient on what they consider "the start of the final action." So if your opponent searches, and you counterattack and land before they finish their search, good stop hit. If you avoid their search, you had the opportunity to counterattack and instead used it to avoid the search, and it's still their attack. Similarly if you just watch them miss with the search. Or just accept that the rulebook is only a very vague and badly written guide to right of way, and just watch a bunch of foil on youtube and learn right of way that way.