If I understand correctly, you are trying to condition the distribution that increments the model on the presence or absence of some feature of the data. Have you considered nesting a conditional statment in your for loop?
model {
for (n in 1:N) {
real C = col(P,n)' * lambda;
vector[K] lps;
for (k in 1:K){
if (condition) {
} else {
}
}
target += log_sum_exp(lps);
}