On bigger jobs you need to reduce your dataset some and limit the number of calculations. Filter your selection to only include groupings of elements via scope boxes, levels, or other location data. You’re currently asking the CPU if that wall on the top level of the north facade intersects with the slab in the south side of the lowest basement, something you wouldn’t even bother thinking about if you were running it by hand.
After limiting your datasets you can speed things along further by running simpler tests where you can. Bounding box containment quick and helps reduce the difficult test by a good amount. Generate a bounding box on one list in the dataset (floors or walls) and element.location or a bounding box on the other (depending on element type). Is the item a partially in item b? If so then run the geometry test. If not skip it. This will limit your testing time significantly, but larger jobs may still be slow to finish.
If you find it is intolerably slow, run it when you’re heading off to a meeting, or lunch, or coffee. just remember you will take ownership of a LOT of elements with this script, so there may be some worksharing issues.
One last option to speed things along, but it may not work: try using Revit’s built in clash detection to get a list of elements which intersect, meaning you want to join them together. Depending on how you modeled things it could work very well or it could work very poorly. Either way asking dynamo to join element a to element b via the results read from an HTML file would be much faster than gathering, sorting, gross testing, fine testing, and then joining.