It would do that assuming
1. That this says ignore is on: /ignore
2. This is not checking whether the nick is in a shared channel with you 10 seconds in the future, or at 20 seconds in the future, or whether you've already ignored them in the past yet are still sending them a query.
3. The fact that you're opening a query window on them, yet ignoring any reply from them doing the same to you is an indication that you're violating the golden rule of doing something to others that you don't want done to you.
4. This is a good way to create a denial of service attack against you. All that's needed to get you to ignore a nick that you don't want to ignore is for someone to join a channel you're in after first changing to that nick.
5. The ignore only applies to anyone using that specific nick at that specific $network, and they're no longer ignored once they change nick. If you used "ignore $nick 2" it would apply the ignore against a wildcard of their address, but only if that nick was in a channel with you 20 seconds in the future.
6. Sending a query to all nicks who join a channel they share with you is going to quickly get YOU ignored by people tired of having a query window opened on them by you. And if they complain to the Ops, you'll likely get told to cut it out or get kicked.