Ok.
What if you create your own function? That way you can simplify the example I wrote.
Let say we have created a function uf_add_missing_column which takes as params the table name and column name creates the column if not found?
It should be easy to modify those command to a single function.
Andreas.