Custom module blocks: where to put html code?
You could improve that with 2 different options:
1) Creating a theme function
2) Creating a template file (tpl)

The tpl may be a cleaner option, but they are both similar. In both cases, you should pass preprocessed variables instead of putting the logic inside the theme function/tpl file.

Also, note that the literal strings should go through the t() function.