May not want to cut out the isObject. If some add-on decides to clear the tool by setting the slot to -1 it'll mess up.
But then again, something similar goes for the rest of this premature optimization.
May not want to define it in the actual if test. If somebody is trying to learn TorqueScript or is trying to modify the code they might get wrong ideas about the language or mess it up.