I had the chance to finish this script.
I found that my best (and accurate) solution was to use Rooms Boundrais to create dynamo extrusions, then increase their thickness, and then Element.BoundingBox for the windows/curtain panels, then using GeometryDoesItersect I could have a mask to use it later to have curtain panels/windows grouped by rooms.
Also I found that the node "Get surrounding elements" was using the BoundingBox method. that's why it was not giving me accurate results especially that I have a lot of irregular room outlines.
Thanks a lot for your help!