The recomputation of floodfill values should be triggered upon the discovery of a new wall. If your implementation cannot tell whether a new wall is discovered, then at least trigger the recomputation when a wall is mapped/confirmed.
It is best to know whether a confirmed wall is already in the map before adding it. If a confirmed wall is already in the map, there is no need to waste time recomputing floodfill values.
After floodfill values are recomputed, there is no need to immediately determine what to do next. The decision regarding what to do next (keep going, stop or turn) should be triggered only when such a decision makes sense.