Lock-range code for Google Scripts/Sheets
It's not necessary to include SpreadsheetApp.flush() as the last command of the if blocks because there aren't any command to be executed after those blocks and Google Apps Script submits all the changes to the spreadsheet when the script execution ends. If you remove them, you will be saving three code lines.
On some scenarios using one sheet.getDataRange().getValues() is faster than having several sheet.getRange(...).getValue().
Using e.range.columnStart is faster than e.range.getLastColumn();