How do I create a constant loop with an event that only occurs once?
What you want is not to check the distance but to check that the distance condition changed.

static boolean present = false;


Inside loop:

if (present == false &amp;&amp; distance &lt;= 150){
    personPresent();
    present = true;
} else if(present == true &amp;&amp; distance &gt; 150) {
    personAbsent();
    present = false;
}