Modifying behavior of "You Saved..." info in cart when attributes are chosen
Doing this in jquery is probably going to be the quickest way to achieve this, especially since you're dealing with custom code. The jquery code you posted is close, but you need a different approach to test if the list-item contains text:

$(document).ready(function(){
    if ($('.item-list' + ':contains("someothertext")').length != 0 ) {
        $(".cart-savings").toggle();
    }
});


Also, note I used the toggle() function here which is a quicker way to determine visibility than adding / unadding a visibility class. 

You can verify the above code here: http://jsfiddle.net/JZnPq/