Rather than looping through every table, I would use the Find command along the following lines.
Code:
Sub TableTags()
Dim str As String, aRng As Range, sPrefix() As String, i As Integer
Dim insertTextAbove() As String, insertTextBelow() As String
sPrefix = Split("B|E|I", "|")
insertTextAbove = Split("123|456|789", "|")
insertTextBelow = Split("333|666|999", "|")
For i = LBound(sPrefix) To UBound(sPrefix)
Set aRng = ActiveDocument.Range
With aRng.Find
.Forward = True
.Text = sPrefix(i) & "BEGINING"
If .Execute Then
If aRng.Information(wdWithInTable) Then
Set aRng = aRng.Tables(1).Range
aRng.Collapse Direction:=wdCollapseStart
aRng.MoveStart Unit:=wdCharacter, Count:=-1
aRng.InsertBefore vbCrLf & insertTextAbove(i)
GoTo NextOne
End If
End If
End With
NextOne:
Next i
For i = LBound(sPrefix) To UBound(sPrefix)
Set aRng = ActiveDocument.Range
With aRng.Find
.Forward = False
.Text = sPrefix(i) & "ENDING"
If .Execute Then
If aRng.Information(wdWithInTable) Then
Set aRng = aRng.Tables(1).Range
aRng.Collapse Direction:=wdCollapseEnd
'aRng.MoveEnd Unit:=wdCharacter, Count:=1
aRng.InsertAfter insertTextBelow(i) & vbCrLf
GoTo NextTwo
End If
End If
End With
NextTwo:
Next i
End Sub