SQL: fixes, improvements for multi-statement queries

Add highlighting for the selected section, proper targeting, and several
fixes for plan details