The AcceptBattlefieldPort(1,1), the first 1 here is the index, it is a list of BGs you are qued for.
IE
If you are qued for WSG (1), AV (2), and Strand (3), and they all pop at one time.
AcceptBattlefieldPort(1,1) Will take the WSG que.
AcceptBattlefieldPort(2,1) Will take the AV que.
AcceptBattlefieldPort(3,1) Will take the Strand que.

So the first number in parenthesis will tell the client (game) which que and the second number will tell it what to do (1 is enter, 0/nil is leave)

(Servers are down, so i can't test this), but

/run
AcceptBattlefieldPort(1,0);
AcceptBattlefieldPort(2,0);
AcceptBattlefieldPort(3,0);
AcceptBattlefieldPort(4,0);
AcceptBattlefieldPort(5,0);
AcceptBattlefieldPort(6,0);
Should yank you OUT of the battleground. Caution: it will pull you out regardless if the BG is done, so if you leave before, it will probably give you deserter.

Taken from:

http://www.wowwiki.com/API_AcceptBattlefieldPort
Arguments

index Numeric - The battlefield in queue to enter.
accept Boolean - Whether or not to accept entry to the battlefield.

Details


Passing 0 or nil as an accept argument will cause you to leave the queue for the battlefield, if you are inside a battlefield you will leave it regardless if it's ended or not.