What do you mean by it's not working as expected -are you not seeing the expected records, or are you seeing an exception?
I suggest you initialize the variables conditionCustomer and conditionAddress to empty strings. the Liquid processor behaves oddly with uninitialized variables.
assign does not look correct. i would use a capture instead.
and the evaluation of the lace_customerpropertiesid - assuming that is a lookup, i think you need to evaluate it differently.
{% assign customerid = request.params['customerid'] %}
{% assign addressid = request.params['addressid'] %}
{% assign cacheString = request.params['cacheString'] %}
{% assign conditionCustomer = "" %}
{% assign conditionAddress = "" %}
{% if customerid %}
{%- capture conditionCustomer -%}
<condition attribute="lace_customer" operator="eq" value="{{customerid}}" />
{%- endcapture -%}
{% endif %}
{% if addressid %}
{%- capture conditionAddress -%}
<condition attribute="lace_address" operator="eq" value="{{addressid}}" />
{%- endcapture -%}
{% endif %}
{% fetchxml customerProperties_query %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" returntotalrecordcount="true">
<entity name="lace_customerproperties">
<attribute name="lace_customerpropertiesid" />
<attribute name="lace_name" />
<attribute name="createdon" />
<attribute name="lace_address" />
<order attribute="lace_name" descending="false" />
<filter type="and">
{{ conditionAddress }}
{{ conditionCustomer }}
<condition attribute="lace_name" operator="ne" value="{{ cacheString }}" />
<condition attribute="statecode" operator="eq" value="0" />
</filter>
</entity>
</fetch>
{% endfetchxml %}
{
"totalcount": {{ customerProperties_query.results.total_record_count }},
"customerProperties" :
[{%- for result in customerProperties_query.results.entities -%}{
"lace_customerpropertiesid" : "{{ result['lace_customerpropertiesid'].id }}",
"lace_address" : "{{ result.lace_name }}"
}
{% unless forloop.last %}, {% endunless %}
{% endfor %}]
}