I’m sorry, but I still don’t understand what you’re talking about here. This seems very similar to old scripting languages like asp and older styles of php (granted a lot of people still use this method, but “good practice” suggests other methods.
Mixing front-end with back-end should be avoided as much as possible. The maintenance efforts go up exponentially when mixing the two vs separating them out.
edit:
Just saw what you added. How is that any different than this in classic asp?
<% if a > 2 then %>
A is bigger than 2
<% end if %>