Don’t think this is possible right now, but it would be nice to have some kind of context for the current page that could be used to store some variables on.
Right now I try to create a new short code - it needs to include some javascript, but I only need to include that once per page.
So I want to say
$page.jsIncluded = true
And
if not $page.jsIncluded