I use a filament run-out sensor/Switch and it detects when the Filament has run out not when it does not move.
They have a filament movement sensor that should pause the print when the filament stops moving.

One option is here