Yeah you could basically use the same thing he did, but specify a range instead of grabbing every entry.
You would start with his query and just specify to only grab items in your range which could be done like so
This would grab all of your custom entries. Then just by looking at Laurea's version you could see how to loop through all the rows and extract the data you need.
"SELECT `entry`, `class`, `subclass`, `SoundOverrideSubclass`, `displayid`, `InventoryType`, `Material`, `sheath` FROM item_template WHERE `entry` BETWEEN "..Start.." AND "..End..";"
I don't know LUA one bit, so I can't help with specifics, but this will improve the performance drastically.