This sounds like the the typical non-contact thread break detector problem. This is a difficult task due to many variables such as thread position (affected by loss of tension), IR reflection (not all colors reflect the same amount of IR light), affect of nearby surrounding objects that also reflect IR light (it is almost impossible to make such objects black to IR), the long & variable range (a fixed 5mm range would be much better), and the affects of ambient IR illumination (must work in any ambient light condition). Then there is the reliability issue as a false indication can cause a production line to stop--must be very reliable. I have been there and done that and have failed. However, I still believe that it is possible with certain limitations, but it will take a serious on-site development effort by a competent engineer. As a result, it is clearly beyond the scope of electroschematics.com. I hope that this helps to flag some of the issues that you may encounter.