That does search anywhere in the name: '%X%' will find all rows with an 'X' anywhere in the value.
I just double checked with one of my tables:
DECLARE @SearchTerm NVARCHAR(MAX)
SET @SearchTerm = 'X'
SELECT * FROM MyTable
WHERE [Name] LIKE '%' + @SearchTerm + '%' OR @SearchTerm = ''
And it retruned exactly the results I expected.
I'd look at the rest of your query, if I was you.