Twine nested conditionals? (if, then if, else, else)

Twine Version: 2.8.1 Linux
Harlowe

Hi all,
I want to do something like this:

If visits = 1:
    text for first visit
    If inventory does not contain Item:
        display message if no item
    else:
        display message if have item
elseif visits = 2:
    text for second visit
    If inventory does not contain Item:
        display message if no item
    else:
        display message if have item

I am wondering if this can be done?

Here is the actual code I’ve tried, but it fails:

(if:visits is 1)[
	This is a text for first visit.<br><br>More text here on line 2.<br>
	(if:$inventory does not contain "sign")[
    	There is a [[sign]] attached to the door.]
    ]
    (else:)[
    	I have taken the sign.  Maybe I should open this door and head into the [[room]].
    ]
]
(else-if:visits >= 2)[
	(if:$inventory does not contain "sign")[
    	There is a [[sign]] attached to the door.]
    ]
    (else:)[
    	I have taken the sign.  Maybe I should open this door and head into the [[room]].
    ]
]

Is this something Twine can do?

Thanks so much

I think the only thing wrong here is that you have a closing square bracket after There is a [[sign]] attached to the door.] and also on the following line.

If I fix that it seems to work.