An abortion is also OK on the same grounds: a fetus before 3 months of gestation is definitely not sentient, and killing it could prevent a great deal of hardship. To be clear, I think abortion is horrible, but it could be the least bad option available.
For this cockroach control toy, it's not clear that it causes the cockroach any pain, but it sure looks like torture. The potentially utility of it looks rather low as well. I can see that it could be useful for learning (and maybe some science as well) but I suspect at lot of people will buy it just for entertainment. That is what makes me very uncomfortable about this device.
[1]: en.wikipedia.org/wiki/Animal_slaughter
I'd have no problem with a device that kills cockroaches faster. I am, however, against cruelty.