There is a way to dynamically add a script to objects, although I would not recommend doing it on books, especially since there are some books and mods that already have scripts on them. But you can research it and decide for yourself:
http://www.creationkit.com/index.php?title=Dynamically_Attaching_Scripts
You may try creating a new instance of the bookshelf activator (don't use the vanilla one to add a script to) and whenever its activated get the book information and set it that way. or whatever activator the books actually go into. I'm not sure how or if the activator keeps track of its contents, but you could look into it and see if you can't manipulate it that way.
On the PlayerBookShelfContainer object, there is a PlayerBookShelfContainerScript.
Within it keeps track of all the books that are linked to the dummy (DefaultBookShelfBookMarker) you set up.
Using that you should be able to set each of the references to do as you want. I don't know where you got DisableHavokOnLoad from, but you should probably use setMotionType(Motion_Keyframed)
http://www.creationkit.com/index.php?title=SetMotionType_-_ObjectReference
You could try doing it in the Event OnCellLoad block but that isn't going to work right. it only calls that event once the cell is loaded initially, that isn't going to help you when you enter a cell and then start putting books into your bookshelf, they will havok, then the next time you come into the cell they will be frozen in their havok'd state, which may cause some issues.
What you want to do is use the Event OnItemAdded and the Function RemoveBooks.
In the OnItemAdded Event,
and finally you MAY have to reset the motiontype whenever you remove a book, so just revert your changes according to the ck.com link i gave you for the static motion type in the removeBook function. Although I don't think you have to because it should'nt be affecting the base item or even the reference to the book directly, only whenever its in the dummy container.