Wow, interesting work.
But would be lot's more useful with the GetSetMedia...()-functions exposed to Lua in some way...Do you have any plans on including those or releasing the source code so those could be included? Probably with some more "nicer" wrapper-functions, because you call for example GetSetMediaItemInfo() something like this from C++ :
To get item's length :
double ItemLen=*(double*)GetSetMediaItemInfo(PointerToRea perItem,"D_LENGTH",NULL);
To set item's time position :
double NewPosition=2.5;
GetSetMediaItemInfo(PointerToReaperItem,"D_POSITIO N",&NewPosition);
(The item time position property also has some additional problems about the item order indexes internally kept in Reaper, that should be handled as a separate case...SWS gave me a working solution to that, so that is covered.)
So, the Lua wrapper should give more easier access to the items etc (handle safely the stuff with pointers to the items and their takes) and wrap all the "D_LENGTH", "D_POSITION", "B_UISEL" etc stuff into separate functions/methods to get and set item/take/send/track properties...