Pretty cool. You need to update your design to include an encoder wheel spun by the moving filament and a sensor that can read pulses from said encoder wheel so that if the filament jams on the other side of your sensor it will still trigger. The 'smart' filament sensor is big and bulky and has 3 wheels where it could surely survive with 2 so there is definitely room for improvement. Go rework your idea into something on par with the day, kid. Like one of these: Filament sensor - Collections - gordonmuvesz - Thingiverse

Show me something that can see the filament moving and when it stops and is smaller and lighter than the smart filament sensor and I might be impressed. But so far as I know nobody in this industry has been impressed with them microswitches for a while now. But a hall effect sensor that can generate pulses every x amount of filament travel, now that is something to behold in the realm of filament runout detection. Wouldn't you agree?