Personally, I wouldn't do it that way. I'd prefer to configure those options using the customsettings.ini file and keep the complexities out of the task sequence. If you are set on doing it your way, read on...
What is the value of the %MACHINE_NAME% variable? What are the 3 letters you are trying to match? Suppose the first three letters of the hostname you are looking for are 'DSK' and 'LAP', your queries should be:
SELECT * FROM Win32_ComputerSystem WHERE Name LIKE 'DSK%'
SELECT * FROM Win32_ComputerSystem WHERE Name LIKE 'LAP%'
Or you could query directly on the OSDComputerName value you set. That would probably be even better