Thank you for your replies. In the end, a combination of your suggestions helped me.
I want to state what did and what did not work:
- Adding property to WiX with a default value was not necessary (as well with adding property of this property Secure='yes')
- Calling custom action before CostInitialize did not solve the problem on its own, but I believe it was one of the factors that resolved an issue.
- Conditional sintax was corrected by:
a) Putting condition inside of CDATA and adding quotes to the value of property as suggested:
b) Reversing condition levels so feature has condition level 1 and condition has level 0. This means that feature is always installed, unless the condition expression is false.