Can't be done in a script. Even if it could be done, it would break usability.
The green bounding box is part of the reason people like AC3D
. Without it you would be constantly switching operation modes as you mention.
Click anywhere outside the box to clear the selection.
Hold down shift and you can select inside the bounding box (shift+middle mouse button will remove from the selection).