The trouble with things like this is, if you pick them up in your inventory to move them to or from the hotbar, you get an extra stack dumped in a random place.
Steve's Factory Manager would do it brilliantly! You could have a condition that removes torches if you have more than 64, and adds them if you have less. *Edit* Hm, that would still mess up the locations, as it adds them in odd places. You could target a specific slot to always have torches though, and have another slot that you can place excess torches in to be picked up from and removed. Yeah, this would be complicated to get right. Unless you just always wanted torches in one place.