My first thought is that this isn't a scripting issue, or a searching issue, but one that can probably be solved by relationships.
In my application, there's a room booking function, which sounds functionally similar to what you're trying to achieve. In my situation, there are Sessions (with a date, start time, and end time). Each Session has a number of Resource Bookings (the Resource Bookings table being the join between Sessions and Resources).
I have a relationship that uses globals in the Sessions table (x_Date, x_TimeStart, x_TimeEnd) to determine which Resources are booked at a given time (Sessions > Sessions Now > Resource Bookings > Resources). So from Sessions, it's possible to list all Resources booked during a given time period.
Then there's a calc field in Sessions called ResourcesAvailable, which is basically a list of all Resources which aren't in the list of booked Resources, and these are offered to the user as being available. The calc uses the excellent FilterList custom function (see Brian Dunning's site), i.e. something like
List (SSN to RSC ~ All resources::RSC__kp_ID);
List(SSN to SSN to RBK to RSC ~ BookedResources::RSC__kp_ID);
So no scripting or finding, and the list of available resources is "always" up to date. (I say "always" because there might be refresh issues, but it's real-time enough for my purposes, and we've not had a double-booking yet.)
Might that fit your scenario?
Was this of any use/interest?
The information was quite useful. Did not have a chance to try it yet. Have been enroute for business. I will keep you posted.
Peter M Carr