yes you can build your logic in content block as
<%
var fieldName = context.targetData.target.fieldname;
var defaultValue = ‘default’;
%>
<%
if (fieldName.length > 0) {%>
<%=fieldName%>
<%}
else {%>
<%=defaultValue%>
<%}
%>
Please try this out and let me know.