Automatic tile wall creation in WC

Hello,
i tried this script for automatically creating tile walls inside room walls and works well (as shown below). But it covers entire wall and sometimes in kitchen and WC we have tile covering some part of wall and i need to do that. Any good approach or idea is appreciated. I mean so that we still can automate it but depends on our wish so that how high it should be.