But think about this: what if you want to end such a value with \? Do you then escape that too, e.g. value1, value2, value3, value4 ends with slash\\,value5? Because then it's going to be a bit harder; you have to check the number of preceding backslashes - even means don't escape the comma, odd means do.
But in the end you'll be redefining the CSV format. It has already thought of these issues. It uses value quoting to allow commas inside values, but also allows quotes inside values. Check out
AccessingFileFormats under the Excel section to find a few libraries that can read and write to CSV files.