How about this, create a new script variable called 'transferring' or something. Then in your connect to live agent script you add

vaVars.transferring = true;

Then in your closing you should be able to use that new variable in the if/else statement and clear up the bogus closing for the items not being transferred.