I personally don’t use “turn off after inactivity” logic for exactly the reasons you gave–too easy to turn the lights off too soon. Bathrooms are particularly problematic because people taking baths rarely register on motion detectors. So I’m not the right person to contribute on this topic.
@bravenel and @baldeagle072 are grandmasters on the use of motion sensors and lights and have written code for many different use cases. Hopefully they’ll chime in.
Also @rayzurbock has a smartapp for just this purpose. Much discussion in that topic, although I think he’s been working on other projects lately. He added a humidity sensor to solve the shower problem, which was an interesting approach. Anyway, the topic’s worth reading.
And the following topic had much helpful discussion of motion sensor lights in the kitchen.