Your first IF does not have an Else condition, or it has one too many brackets.
Coding in formula language is very tricky if you go beyond basic things like retrieving data for a keyword list or setting the value of a field.
In my opinion, what you are trying to do seems too complicated for a single-field formula.
I would suggest breaking it down into several Computed-For-Display fields, where the last field computes only if the condition field allows it too.
That way, instead of bothering with complicated IFs, you just use a simple check like this :
Code:
@if(condition field = FALSE;@Return("");"")
and then go on writing the rest of the code.
In this case, if the field allows the second part to execute, the @If condition will resolve to ELSE, which does nothing, which in turn goes on with the rest of the calculation, whereas if the check is TRUE (ie the field is FALSE), then the check resolves to @Return, which will end code execution immediately.
Pascal.