Access to underlying Illustrator object handles via scripting
The biggested pain point when implementing scripting support for plugins is that if you want to add objects that interact with built-in Illustrator script objects (LiveObjects) like Layers, Documents or PageItems. While it's possible to correctly parse whether you're being passed the correct scripting object (e.g. a Layer and not something else) you can't actually determine the handle for the specified object; that lives inside the ScriptingSupport.aip and has no public API.
Perhaps a small suite could be added that provides methods like this:
AIAPI AIErr (GetDocumenttHandle) (long hObject, AIDocumentHandle& outHandle);
AIAPI AIErr (GetLayerHandle) (long hObject, AILayerHandle& outHandle);
AIAPI AIErr (GetPageItemHandle) (long hObject, AIArtHandle& outHandle);
These are the three most important objects, but more could be added in the future.
Andrew Patterson commented
I'm guessing the most logical place to export such a suite would be ScripingSupport.aip, since it would likely have easy methods internally for looking up an hObject, insuring it's the right type, fetching it's internal data pointer, and returning the handle stored therein (I assume).