fix #11261: improved logic for inserting measures

-Insert now works when an element inside a measure is selected, instead of only when the whole measure is selected
-Inserting a measure selects the new measure, so that it is ready for input
-Inserting multiple measures checks that a measure (or element in a measure) is selected before displaying the dialog