To accomplish this, simply wrap the class in a conditional expression so that the CSS doesn't show up if the config tiddler isn't set appropriately:
<% if [[$:/config/ShowFunnyText]text[yes]] %>
.my-funny-class2 {
background-color: blue;
color: yellow;
font-size: 150%;
border: 3px dotted orange;
text-align: right;
}
<% endif %>
Note that, as discussed above, the content type must not be text/css
here, or conditional expressions won't be evaluated.
The filter can be written in several ways; for instance, you could equivalently use:
[{$:/config/ShowFunnyText}match[yes]]