Basically, you will build a multi-dimensional array based on the userid, the actions you want to validate, and the tasks to perform for each action:
Code:
[userid] => array([actionid] => array([taskid] => array('taskitem1', 'taskitem2', 'taskitem3')))
then you walk thru this array later and build up one query to INSERT each lot of PM text's, run each lot of user UPDATES, etc.