How to move the edit tab in node.tpl.php
The $tabs variable is set up in template_preprocess_page(); you can add the same var to the node template file by implementing a preprocess hook:

function MYTHEME_preprocess_node(&amp;$vars) {
  $vars['tabs'] = menu_local_tabs();
}