The category won't show up in the chunks part of the tree if it has no chunks in it.
I never mess with the categories_closure table directly, because changing a category's location in the tree often requires rebuilding a number of closures. When you change the parent in code and save the category, this is done automatically. That's why I use SiteCheck.
FYI, here's the code that rebuilds the categories_closure when the parent changes:
/**
* Rebuild closure table records for this instance, i.e. parent changed.
*/
public function rebuildClosure() {
/* first remove old tree path */
$this->xpdo->removeCollection('modCategoryClosure',array(
'descendant' => $this->get('id'),
'ancestor:!=' => $this->get('id'),
));
/* now create new tree path from new parent */
$newParentId = $this->get('parent');
$c = $this->xpdo->newQuery('modCategoryClosure');
$c->where(array(
'descendant' => $newParentId,
));
$c->sortby('depth','DESC');
$ancestors= $this->xpdo->getCollection('modCategoryClosure',$c);
$grandParents = array();
foreach ($ancestors as $ancestor) {
$depth = $ancestor->get('depth');
$grandParentId = $ancestor->get('ancestor');
/* if already has a depth, inc by 1 */
if ($depth > 0) $depth++;
/* if is the new parent node, set depth to 1 */
if ($grandParentId == $newParentId && $newParentId != 0) { $depth = 1; }
if ($grandParentId != 0) {
$grandParents[] = $grandParentId;
}
$cl = $this->xpdo->newObject('modCategoryClosure');
$cl->set('ancestor',$ancestor->get('ancestor'));
$cl->set('descendant',$this->get('id'));
$cl->set('depth',$depth);
$cl->save();
}
/* if parent is root, make sure to set the root closure */
if ($newParentId == 0) {
$cl = $this->xpdo->newObject('modCategoryClosure');
$cl->set('ancestor',0);
$cl->set('descendant',$this->get('id'));
$cl->save();
}
}