The ampersand and equals signs in the if and else are causing the problem. You could replace them with AMP and EQUALS and have the snippet translate them back with str_replace() or you could try putting the ditto calls in two separate chunks and just send the chunk tags as the if and else parameters.