Ah sorry then - first thing that caught my eye when I had a quick look at it, I’m no master with DesignScript. Calling ‘return = [Imperative]’ may be for when it’s part of a custom function rather than just a code block. Looks like your setup will work fine with the OOTB “If” node though if you need a quick solution.
Looking closer now, I think its likely a list level issue as if I copy your code block with simple inputs it’s fine, but if I throw it a list of booleans it breaks. I’d probably still lean towards using the OOTB if node, or simplifying your designscript to a single line command e.g: