Thanks for the feedback and sorry this is so painful for you. When you highlight a selection and accidentally delete it by pressing another key, is it not enough to perform edit | undo once to get your code back? Also to save time, I'd personally suggest using the shortcut Ctrl+Z to quickly undo any mistakes rather than using the menu item.
Either way, this isn't a solution for problem (just trying to clarify what is going on). We've got a feature request to toggle the focus after a run to either the console of the source. Originally, we actually had it as you suggested (place focus in the console after a run), but got a lot of negative feedback on this due to the majority of users working primarily in the source (editing, running, and editing again all in the source rather than the console). This was for reproducibility purposes as well as ease of use.
As you've suggested, I'll chalk up another request on this feature suggestion to allow the user to choose the behavior. Also one for placing the undo button on the menu.