I'm using:
/script AcceptBattleFieldPort(1,1)

Is there something similar to click the "Leave Battleground", at the end?