Where do I set which template file to use for a block?
Most of the times I just do 

$block['subject'] = t('My block title');
$block['content'] = theme('my_custom_theme', $block_content);

return $block;


from hook_block_view() function if you're making a module that creates a block. The theme function my_custom_theme can use a template file such as my-custom-theme-block.tpl.php. Also you can suggest theme hooks through hook_preprocess_block. Just check for the delta of your own block and set a theme hook there.

function HOOK_preprocess_block(&amp;$vars) {
  if ($vars['block']-&gt;delta == 'my-block-delta') {
    $vars['template_suggestions'][] = 'my-custom-theme-block';
  }
}