I'm not sure the OnEquip logic works for books. You may want to try with OnActivate. If you want the player to gain a permanent increase of magicka points the best way is to add an ability to the player with the addspell command, not cast a spell on the player. (the "cast" command tends to be pretty iffy most of the time anyways). You can also use ModAV, but that value can mess up stats if it's used incorrectly. Although I doubt your script would cause any real issues with stats since it has a DoOnce flag attached to it. Anyways, it's better to be safe than sorry.
ScriptName BookofMagikashort DoOnceBegin OnEquip if ( DoOnce == 0 ) player.addspell BookofMagikaAbility set DoOnce to 1 endifend
If for some reason that won't work, you could try using an OnActivate block instead, but I assume that will only work if the book is not placed in a container.
ScriptName BookofMagikashort DoOnceBegin OnActivate if ( DoOnce == 0 ) player.addspell BookofMagikaAbility set DoOnce to 1 endifend
Hope this helps...