Drawing is done per frame, so you really have to put it into a when drawing section. The Stencyl compiler won't let you put it anywhere else, even if that event is only called when it's drawing.
To make it work, you need another boolean (like JeffreyDriver suggested) and in your When Drawing section:
if <showInv> and <InvOpen>
I'd just use a [set <showinv> to not(<showinv>)]
that will switch it between true and false.
I think you might also want to set some styles for your box, because the engine doesn't know what stroke width, color, or anything else that you want.
EDIT: Was a bit late, your error was caused because you didn't set the styles.