You second task can be implemented with the asynchronous trigger model.
Old forum showing the feature:
asynchronous sampling from the source timing - capture transients
I will upload a simple LabVIEW sample for loading scripts/functions and then making use of the functions from VIs.