Your sub will not even be invoked if the user double-clicks on a locked cell when the sheet is protected, so I'm unclear on what you're looking for.
First let's get terminology lined up: A cell can be locked or unlocked. A worksheet can be protected. If a sheet is protected, you can select options to restrict what a user can do to locked cells on that sheet. If a cell on a protected sheet is unlocked, then there are no restrictions on that cell.
What is it you want to happen if the user double-clicks a locked cell on a protected sheet? Excel will display a dialog box telling the user that the action is not allowed, even if you have a Worksheet_BeforeDoubleClick sub.
By the way, your assignment to the cell probably works but is misleading. You may want to use
Bookmarks