I see your reasoning, although such abilities already exists using $iif
This example menu item is only added to the menu if connected ($connected just checks $status for a status of connected and returns $true or $false)
menu test {
$iif($connected == $true, Disconnect):disconnect
}