You can probably make use of the active item use mechanic used by bows, food, shields, etc.
Try overriding Item#onItemRightClick to do the following:
Call EntityLivingBase#isHandActive to check if the player is actively using an item.
If they aren't, call EntityLivingBase#setActiveHand to make the player start using your item and then perform the effect.
If they are, do nothing.
You'll also need to override Item#getMaxItemUseDuration to return the maximum duration in ticks that the player can actively use your item (bows and shields use 72000, which is 1 hour), and optionally Item#getItemUseAction to return something other than EnumAction.NONE.