One way would be to use CTRL+J to teleport out. See here on how to enable the CLUA console if you haven't already done so. Once you've done that, hit CTRL+SPACE in-game to bring up the console, type in: "CLUAConsole:EnableCheatKeys()" (without the quotation marks). Then select the character and press CTRL+J. He'll teleport to wherever the cursor is.
Comments
In program files write Debug Mode=1 (the old game used Cheats=1 under game options but i'm pretty sure BG:EE use BG2 style).
Inside the game click Ctrl+space, that will open the cheat menu. Tipe CLUAConsole:EnableCheatKeys("") to activate hotkey cheats.
Click in the bind character, select it, position the mouse into a free spot where you want to teleport it, then click Ctrl+j.