Is that what you had in mind?
Attach the new_bookcase.lua to the bookcase halves.
Attach the bookcase_items.lua script to any item you want to put in the bookcase, name the entities BC_ItemL or BC_ItemR depending oin which half you've put it in. Physics 'off' for these items btw, and always active just to be on the safe side.
Make sure the 'immobile' setting is no as well.
I need to figure out a slightly better way of allocating the items to the bookcase halves as currently it will only work with a single pair of bookcase halves, hopefully the next version will allow multiple pairs to coexist in the same map (could simply only allocate the items based on the closest bookcase).
Been there, done that, got all the T-Shirts!