Rational for challenge: Like NPCs, cool and clever uses for a spells by NPCs exist merely for the entertainment of players and the telling of stories. These spells should be implemented only when they affordd the players an interesting challenge.
The rope trick is a challenge, and solutions exist to address it. The questions really are A. is it interesting enough of a challenge to be worth their time? and B. Does the party have access to tools to address this challenge?
Nature/review of challenge: 1. There's a living alarm system in place, and 2. as soon as it's triggered the wizards fly up to the clouds (using fly spells) and 3. flee into extra-planetary space using the rope trick, where they presumably rest (refreshing the fly spells if the caster of the rope trick has a high enough level to cover the time they need to rest). The spell expires at some point (after caster level hours) and dumps all the contents out (unless they leave before it expires), leading to a brief shower of wizards raining out of the sky - or feather falling if they have the spells prepared. Then they wander back from where ever they fell to that location with the air elemental I assume. If they're high enough level at this point they're well rested and could repeat the process if the party triggers the alarm again. -- If the casters who open the rope tricks aren't 8 or higher, then they'll need to resort to alternative ways to access flight if they haven't rested before attacked again! But they could still use alternative means to flight if they have them. Those could be limitless (artifact that grants flight, perhaps brooms? - to the same effect of CL<7) or limited.
Solution 0: Wait them out
If they're limited but large in number that could probably be used up in a boring repeat until they run out kind of way. That would be a siege scenario - you ask the players do you keep repeating it and fast forward time until they decide to go look for an alternative solution or all the charges or uses of all the wizards means to flight are used up (at which point they haven't properly rested for a long time, instead sleeping a lot for few hours at a time, while our players got to take turns triggering the alarms and are fine). Also consider long before this point the wizards might get pissed anyways and try attacking, rather than allowing themselves to be disturbed in their important bidding all the time.
Note: Rope trick has components: powdered corn and a twisted loop of parchment. How much of that do you think they have as a group? Where do they get more from? If the players mess with access to the components they could do the siege tactic even if they rest (but not if they have infinite alternative access to flight).
Solution 1: Avoid or take out the alarm somehow.
You didn't explain how the air elemental works as an alarm, but surely it could be tricked somehow. It has Listen +2, Spot +3, and 60 ft darkvision, but invisibility would probably work just fine. - Or just sneak up and kill the... blower. It has 9 hp. And even if the wizards still get away this time, getting a new familiar takes time.
Solution 2: Deal with the wizards before they flee
*a.* Keep them from casting flight. I guess solution 0 somewhat did this the slow way, but what about a silence spell? A dispel magic spell? Other anti-magic sources? Interrupt their spell casting with an arrow in the forehead or what ever manner you prefer. Get them to need to take concentration checks by distracting them with poisonous gas traps that you prepared while they were hiding away.
b. use solution 1: invisibility (plus slight of hand for getting the artifact) or hurting them. They're wizards, not clerics - so damage them as good as you can. Even if they can rest, they likely have low constitution so they heal slow enough that they won't recover much before coming back.
c. Trap 'em. hide yourself (with an alarm) in their location waiting for them to return, and then lock the doors after they come in, or otherwise alter the environment so that they're trappped indoors even if flying. Make sure that if you make the entrance collapse you have means of leaving.
d. get flying and while following them keep hurting them, basically extension of 2b.
Solution 3: don't let fleeing stop you
a. If you can fly right away during their escape, follow them right into their holes while they're fleeing. If you didn't have the spell before, how about buying a scroll of flight?
b. If you can't fly at all, but you have access to a spell that does go beyond the planes, find it from the ground. Then let projectiles do the talking. Build a rocket of sorts and launch it right under the hole. It's like shooting the side of a barn but from much further away... so a sniper rocket. While difficult to build, if they succeed and one would kill all the wizards, the dead bodies would fall out of the sky after the spell expires... pretty cool.
c. Or find mundane means to fly and follow them later. Use detect magic to find the entrance as the entrance is invisible to the naked eye but still magic. It might be good that if it takes hours, because you can't look through the entrance of the hole, so you won't know what's going on inside. Of course if you rushed in right after them you know what's going on: they just arrived. But if you're late they might all be aiming their magic at the entrance, as they can look out through the entrance window (if they're not sleeping). - If you wait a little bit and assume they are in fact sleeping thinking that you don't have access to flight nor would find the entrance) you could sneak in and stab them all in their sleep. - muahahaha.
d. wait outside. Since their peek hole is at the entrance, if you find it and have a long term source of flight (like an undead dragon? - or a hot air balloon) park it right above the hole and wait until they leave or start falling.
Solution 4: GM stops NPCs from doing it - ideal if they don't have the tools, or if the challenge seems boring
a. Wizards are people too. Even if mechanically this works, they'll get bored of it or impatient. Perhaps have one of them say "You know what to do, Boys." and another says "Really? We're powerful! Why do we keep running away from these losers? Let's just deal with them!" -- unless they're all elven or immortal they might not want to delay their plans for weeks to play hide and seek with the party.
b. Situation changes. They plan to use the artifact for something (that is deep in a dungeon thus they can't just fly away). Of course if the players don't have means of tracking them that'll be frustrating too, but at least it won't be boring.
c. Come up with your own reason.
Solution 5: Don't worry
a. Let the players figure it out.
b. Break the 4th wall. If you did in fact limit their use and complained to them when they were using the rope trick, rather than figure out a way around it, the situation is unfair. Decide to ban the spell all together and make up a silly ingame explanation.
For example: let them have a conversation with a strange but powerful God. His avatar (form of a crazy person) says to them "You know what, this is getting boring. I've had an interest in you folks for a while now because you know... you're funny. But this stuff... Really wizards running away like that is just cheating isn't it?" - and if they agree with him (rather than or as well as being baffled by what he's talking about and how he knows their situation) he says "Would you agree this world would be a better place without the rope trick?" - And if they the party wizard (and all other wizards nearby if any) suddenly feel a pain. "It'll only hurt for a moment" the joker character says and runs of. If the wizard ever uses that spell again, he'll notice it works slightly different now. It summons a rope as before but at the top is a little note. If he climbs up to read it it reads somewhat like the kind of legal document you get when your service is cancelled because of something someone did (without claiming or denying that it was you). "This free service is temporarily unavailable, report error to plane administrator [and in fine print] The premium membership expired 2 milenia 4 centuries and 3 decades ago, thus shifting to the free version kindly provided by "Too infinity and beyond Inc." as per terms and conditions of use, which the plane administrator read and agreed to. Inappropriate, abusive behavior coming from your plane of existence has been reported, including trespassing and loitering thus violating the fair use clause of the terms and conditions of service. See section IV.9.c. paragraph 2. Until further notice entrance is closed. For upgrading to premium membership, contact us at our office, during opening hours. Sincerely, 2I&B Inc."