in ruby it is usually better to use `||` and `&&` due to its operator precedence. `or` and `and` is used only for workflow control and not in expressions ).
Also to check boolean it is not needed to compare with `true` or `false`
so resulting condition can look like:
```
if  !IP.Check(value[:addr1]) ||(UI.QueryWidget(Id(:enable2), :Value) && !IP.Check(value[:addr2]))
```