Aside from correcting the ON TEXT events so that they use the correct format, the 2nd structure could use if/elseif/else rather than several if's with halt's.

I'm going to presume that the scenario you gave is a generalization, and not specific to your actual needs.