How to create a node in Drupal 7 with a custom nid
http://api.drupal.org/api/drupal/modules%21node%21node.module/function/node_save/7

I believe node_save() takes all the node edit form input and builds a new node with a node-&gt;id for you.

node_save() either tries to update an existing node, or give you a newly saved one. You want to set what NID it gives you back.

Assuming an SQL storage engine for Nodes. You'd have to pick a NID greater than the current SQL MAX(id) FROM {node} ...

You could then make a new node entity with entity_create( See Creating and Editing Entities Documentation ) just passing the bare parameters you want: NID, type, bundle.

Then you could do a node_load() and then a node_save() with your code above to actually build out the rest of the node ...

That's what I would try.