Please provide a definitive example of a before string and an after string. The backslash before the dollar sign makes the purpose of this script ambiguous.
sed '/abc_def/s/'\''.*'\''/'\''\${abc_def}'\''/' filename
Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
Therefore, you need to terminate the quoted expression, insert the escaped quote, and start a new quoted expression. The shell's quote removal does not add any extra spaces, so in effect you get string concatenation.