Studio ASSIGN action overwriting IF logic evaluation

Just noticed my Studio script is skipping the ELSE branch even when the condition is false. I have an IF action checking if a variable is empty, but the ASSIGN action right before it seems to reset the state. Here is the snippet. Is the order wrong?

IF ({{customer.status}} == "active")
 ASSIGN {{result}} = "valid"
ELSE
 ASSIGN {{result}} = "invalid"

The ELSE block never fires.

Try wrapping that status check in a Data Action first to force evaluation. Studio variables sometimes hold stale values if they aren’t explicitly refreshed before the IF block runs.