Handle balanced parens and braces inside $( )