Perhaps it will work better as below:

Sub SortAndWriteLettersClmK()
    Dim ws As Worksheet
    Dim lastRow As Long, i As Long
    Dim matchCountOne As Long, matchCountTwo As Long
    Dim arrData As Variant, results() As String
    
    'Turn off application settings
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    
    Set ws = ThisWorkbook.Worksheets("DATA SORT")
    lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row + 1
    
    'Read data into an array for faster processing
    arrData = ws.Range("A2:J" & lastRow).value
    ReDim results(1 To UBound(arrData))
    
    For i = 1 To UBound(arrData) - 1
        If arrData(i, 1) = arrData(i + 1, 1) And arrData(i, 2) = arrData(i + 1, 2) And _
           arrData(i, 9) = arrData(i + 1, 9) And arrData(i, 10) = arrData(i + 1, 10) Then
            'Matching row found, increment counts based on value in column E (position 5 in array)
            If arrData(i, 5) = 1 Then
                matchCountOne = matchCountOne + 1
            ElseIf arrData(i, 5) = 2 Then
                matchCountTwo = matchCountTwo + 1
            End If
        Else
            'Non-matching or final match in a series - determine what to write in column K
            If matchCountOne > 0 And matchCountTwo = 0 Then
                results(i) = "YES"
            ElseIf matchCountTwo > 0 And matchCountOne = 0 Then
                results(i) = "NO"
            Else
                results(i) = "MAYBE"
            End If
            'Reset counters and set new start row
            matchCountOne = 0
            matchCountTwo = 0
        End If
    Next i
    
    'Write results to Column K
    ws.Range("K2:K" & lastRow).value = Application.Transpose(results)
    'Turn on application settings
    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
End Sub