First of all, server-side macros are limited since they run in a multi-user environment. Secondly, a user in a server session can never change things that belong to the document, e.g. data, or objects that have been created by the document creator. That would be pulling away the rug from underneath the other users. A user can add and share server objects during a session - and of course also delete his own objects. But he can never change or delete objects that belong to other users or the document itself.
Data Quality is a very important thing in Data Visualization however I would suggest to have any cleaning or any type of data related stuff should be done at the time of loading or aggregating data at the data layer.
And the actual end users who are going to analyze the data through visualization should be kept separated from this process.
We have built a file checker utility which is for those people who upload the data files and specifically for them we have built a logic where they can observe which files have missing fields or columns so that they can rectify it in the next job run.