I stumbled on your very use script few days back then i decided to upgrade to paperless 2.1.1 and now the script is not working it says:
[paperless.consumer] Unlocked successfully with password 0***1
but when opening in paperless the file still has the password prompt. I am not sure if this is a script related issue or paperless ngx. Maybe you have an idea or a solution.