Incorrect formula rules

How do I safeguard myself from formula rules which are syntactically ok, but which still don't work because, for example, different value types are being compared (text with date)?


(extract from the iQ Suite log)


If there is an error, the auxiliary field contains an appropriate error message; if the query does not result in an error, it contains the values "false" or "true". If an error ("@IsError") occurs, it contains the result "false" otherwise it shows the result of the actual query ("true" or "false").
This ensures that the rule formula can only return the permitted values "true" or "false" and does not cause the rules to hang.

There is a nice example of a query like this in the iQ.Suite sample rules:
Formula rule: NoBodyDom7
Formula:
_isAvailable :=@isavailable(body);
_HasText := @trim(@Abstract([ABBREV]; 1000; ""; "body" ))!="";
_Hasp7matta:= @contains( @lowercase( @AttachmentNames(0));"smime.p7" );
_isEmpty:=@If( !_isAvailable | ( !_HasText & !_Hasp7matta) ;@TRUE;@FALSE);
@If(@IsError(_isEmpty);@false;_isEmpty);