I see no problem in easier and more reliable OTSM code

if the Off detection works well enough 47uF is more than enough, the discharge down to 2V takes way longer than you ever need for medium presses

on Buck and boost drivers the off detection is a problem as thiose got input capacitors, not sure how this can be handeld, but it srewes OTSM often enough depending on hardware