I don't see why it would be illegal. If you don't want to get sprayed, don't steal bikes! And I don't see what you mean by "delay in the mechanism". It's a compressed gas that is released when you cut into the lock. There's really no mechanism involved here. And if bystanders are standing by watching while someone attempts to steal a bike, they deserve to get sprayed.
Because a person is not allowed to introduce bodily harm or destroy another persons property unless they themselves are in immanent danger.
E.G. you can't light a person on fire for trying to steal your bike. If said person was to stop stealing your bike and try to attack you, you could then light them on fire ( assuming you had a flame thrower or something ), but only if you were, or had a real fear that you were, in danger of losing your life from the aggressor. The same principles apply to intentionally making someone sick. This is the same reason that taser car security systems are illegal.
Furthermore, this may run afoul of poisoning laws, and both the company and owner of the lock would run afoul of lawsuits if someone for some reason was allergic to the compounds in the gas, and died of a result of getting sprayed.
It does not matter in the eyes of the law that the person was doing something illegal at the time, they were not threatening the lives of others.