Check if current node meets conditions, then alter a block's contents? In Drupal 7, how would I check whether the current node being viewed meets certain conditions, and then based on that check alter a block's contents?

To give a specific example, I want to check if the current node on my site is a blog post (like http://www.givingwhatwecan.org/blog/2012-10-04/giving-to-charity-%E2%80%93-a-pain-in-the-eye - the conditions here are being tagged with the 'Blog' taxonomy term, or being of type 'story'). If it is, I want to add the class 'active-trail' to the 'Blog' heading in the menu block atop the page.

If need be, I'm happy to use jQuery, though I'd be interested to know the general 'Drupal way' of doing this.
You can check the content type of current node via preprocessing functions in your theme, but there might be another (simpler) way to do what you want: Drupal adds various information about the current page in the body classes, so you have more options for theming.

To select a specific menu link on all nodes of blog content type you can use the following CSS class: body.node-type-blog and a unique menu link ID (#menu-1000-1).

Add that line to the place where you define the active state of menu items. In your case this will be (in your superfish CSS file):

body.node-type-blog #menu-1000-1 a,
a.sf-depth-1.active, .active-trail a.sf-depth-1 {




Another quick solution would be using jQuery:

if ($("body").hasClass("node-type-blog")) {
  $("#menu-1000-1").addClass("active-trail");
}




Check also Context module for more complex use cases where you need to define a section on your website and apply certain theming/functional changes.