1. I'm trying to write an addon that will detect when my flask effect runs out, then pop up a button to let me quickly use a new identical flask without having to rummage through my bags... but I'm starting to suspect that there is no way for an addon to do that because the function is protected. Is that indeed the case?

    No, you can definitely do it. There's more information in "Taking Action with Secure Templates'

    Is that a chapter in the book? I've been terribly lazy about finishing it :P