I had to add .EnableSelection property to the lock. It's working now. Did I do it right?

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim pswdSheet2 As String
 
'store password to protect Sheet2, in Sheet4.Cells("B2")
pswdSheet2 = Sheet2.Cells(2, 2)

    Sheet1.Unprotect Password:=pswdSheet2
    ActiveSheet.EnableSelection = xlNoRestrictions

    If Not Intersect(Target, Range("E11:L14")) Is Nothing Then
        Cancel = True
        Range("E11:L14").Interior.ColorIndex = xlNone
        Target.Interior.Color = RGB(141, 180, 226)
        Cells(10, "D").Value = Cells(8, Target.Column).Value
    ElseIf Not Intersect(Target, Range("E17:L18")) Is Nothing Then
        Cancel = True
        Range("E17:L18").Interior.ColorIndex = xlNone
        Target.Interior.Color = RGB(141, 180, 226)
        Cells(16, "D").Value = Cells(8, Target.Column).Value
    End If
    
    Sheet1.Protect Password:=pswdSheet2, UserInterFaceOnly:=True
    ActiveSheet.EnableSelection = xlNoRestrictions
    
End Sub