This will work only if the setting is left-aligned, which is usually the case, but not necessarily so. Furthermore you are replacing the whole line which would delete comments within the same line, like:
PASS_MIN_LEN 10 # this is a comment
You can make that more robust by:
sed 's/^\([[:space:]]*PASS_MIN_LEN[[:space:]]\)*[0-9][0-9]*/\112/' /etc/login.defs
By the way: you know that PASS_MIN_LEN is obsoleted as it is handled by PAM nowadays, yes?