I was wondering if its possible to get all text within a given brace block (so while (true) { sleep 1; }, get the sleep 1;) and support nested blocks (so once I detect a {, I can find the code inside).

ST2 highlights the brace pair of the block you are currently in, so I was wondering if this information (what region is in the block I guess) is exposed through the API anywhere?