Try a bit easier:
<CommandMethod("SELF")> _
Public Sub TestSelectionFilter()
Dim doc As Document = Application.DocumentManager.MdiActiveDocument()
Dim ed As Editor = doc.Editor
Try
Dim pso As PromptSelectionOptions = New PromptSelectionOptions
pso.MessageForAdding = Environment.NewLine & "Select objects : "
Dim res As PromptSelectionResult
Dim filterList(,) As Object = New Object(,) {{-4, "<and"}, {0, "Text"}, {8, "Layer1"}}'<-- change your layer here
Dim tvs(filterList.GetUpperBound(0)) As TypedValue
For i As Integer = 0 To filterList.GetUpperBound(0)
tvs(i) = New TypedValue(Convert.ToInt32(filterList(i, 0)), filterList(i, 1))
Next
Dim filt As SelectionFilter = New SelectionFilter(tvs)
res = ed.GetSelection(pso, filt)
If res.Status <> PromptStatus.OK Then
Return
End If
ed.WriteMessage(Environment.NewLine + "Selected texts: {0}", res.Value.Count)
''do your mojo here
Catch exc As System.Exception
ed.WriteMessage(exc.Message & Environment.NewLine & exc.StackTrace)
Finally
End Try
End Sub