The NEI API is documented and should be sufficient.
Look at the API class to see where to start. If that's not enough take a look at another open-source mod that implements this feature, and see how it does it.
Both 1.7 an 1.8 have almost complete mappings, just use the daily snapshots.
I haven't encountered any bug or glitch that makes 1.6.4 better than either of those versions.
There is nothing but performance improvements in the newer version, I haven't experienced any framerate drops.
ID's don't change per world.
So if you have to store something in one world that will never need to interact with another world, use block and item IDs.
The preferable method, however, is to get the names of Items and Blocks from the Item and Block registries respectively.