How to check if toolbar is open or closed

FWIW "scripting" in Opus usually means JScript or VBScript.

Simple commands can include some very limited conditional logic via @if and similar but we don't call it scripting (although it wouldn't be wrong to say it is a type of scripting, in the more general sense).

You already had the right syntax for @if:Toolbar NAME="xyz" back in July: