BIGTREETECH has a smart filament runout sensor that watches for movement of the filament not just if the filament is present so when the filament is moving it sends pulses. This sensor is designed to be wired to the printers main board and when the printer is printing and no longer receives pulses due to jam or filament runout Marlin sees this and pauses print. The problem is that Octoprint has no way of knowing this has happened and just keeps sending gcode.
if the sensor could be wired to a GPIO pin on the raspberry pi and a plugin that would watch for pulses coming from this sensor which could then send the pause command when a pulse has not been seen in a configurable amount of time.
Not sure if a plugin could be made to monitor if the pause command has been sent when the sensor is instead connected to the control screen of the printers main board like it is intended to.