It should be noted that this does not, RAW, actually allow a counterspell attempt proper, only dispel some effect(s) already active on the target. For a counterspell, you have to ready dispel magic or the like specifically, and while e.g. wanding it would be fine, an item that only gives you most of the effect of half the spell after you satisfy some condition … wouldn't.
I suspect most DMs would let this slide, and many would probably not actually see the glitch unless it was pointed out.