What does it say in termimal when you run it? The python interpreter usually tells you where the problem is.
sys.stdout.write('\n'.join(sorted(get_queued_alarms())))
print '\n'.join(sorted(get_queued_alarms())) or 'No alarms'
Did you import the sys module?
You can get special characters with the print function, too. Just encode them to utf-8.
Yes, {{color}} only goes to the end of the current line for now. What you could do is set the global color to blue, and then prefix every line that you don't want to have in blue with the desired color.