[stex mode] Reposition some else lines to match coding style
[stex mode] Also reset cmdState on blank line

Issue #2928
Issue #2958