to me this sounds like it would be remedied with a punch in. instead of selecting the notes you want to change, select the timeline above that section of notes you want to change. then click on the RANGE icon for punchin on your CB (control bar). that will also activate punchin. now set your pointer to somewhere a measure or two in front of that first time area and hit record (you also have to have that MIDI track armed, btw). begin playing and sonar will only record during the time that you've selected for punchin and it will stop recording after.
depending on your settings (default is to record multiple takes) you will probably need to go back to the track and delete the previous take because deafult will not automatically delete it. however, it will leave it there and muted and would not ever bother your project as a whole, if you do nothing (personally I would have to delete it, tho, I wouldn't be able to stand know it's there! but I'm OCD about things like that!)