The [ToolsRunMacro] command will always run after all @Functions have executed first. There is no way to change this.
You can get a list of what commands will execute straight away vs after other functions that execute at the end, in the infocenter documentation.
Also something to be aware on your code is that Profile documents are cached. So you might not in all cases see any changes made to the document straight away.