Maybe I am being overly simplistic here, but wouldn't one of the bath humidity fan apps do what you need it to?
They look for a humidity rise, and run the fan until the humidity falls. The only flaw in my theory is they don't have an anti-short cycle which is what I think you are trying to do with the 30 minute timer here.