I think this will work for you.
NPC npc = getNpcs().closest(npc -> npc.getName().equals(npcName) && npc.getInteracting() == null && !npc.isUnderAttack());
If an NPC is being splashed on #getInteracting will not return null (iirc).
Check if inventory is full:
if (getInventory().isFull()) ...
Deposit all except axe:
getBank().depositAllExcept((Filter<Item>) item -> item.getName().contains("axe"));