the riddle chest has code you can adapt for becoming permanently locked. as you are using journal entries, you can deny the player access to the chests before a certain index is reached. to get the journal updated when picking up the key and reading the note, just attach a script to the items in question that looks like this for the book -
short onpcequipshort doonceif ( onpcequip == 1 ) if ( doonce == 0 ) journal ** ; replace "**" with the correct journal index set doonce to 1 endifendif
for the key -
short doonceif ( doonce == 0 ) journal ** ; replace "**" with the correct journal indexendif