After interacting with the items just add another contional sleep to wait until it's back to magic tab ^^
You also have a small logic issue in your script, will make it pretty unstable
if (currentState == State.HIGH_ALCH) {
if (s.getTabs().getOpen() == Tab.MAGIC) {
if(getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)){
new ConditionalSleep(2500) {
@Override
public boolean condition() throws InterruptedException {
return s.getTabs().getOpen() == Tab.INVENTORY;
}
}.sleep();
}
}else{
if(getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED)){
new ConditionalSleep(2500) {
@Override
public boolean condition() throws InterruptedException {
return s.getTabs().getOpen() == Tab.MAGIC;
}
}.sleep();
}
}
}