This code is bad for performance - it doesn a World:GetBlock() lookup twice if the block is not a stone slab. Also, this condition repeats quite often, how about replacing it with a "IsHalfSlab()" static function taking a blocktype and returning bool?