Add a conditional CSS class to the label of the view exposed form
I don't think you need to check for "required" here, just check if the field is not empty, right?

You are first checking if a field is not empty so in the elseif the title will always be empty. You should have two ifs I for your logic to work I believe.

If not empty, do this: if it has this particular value do this otherwise do that.