Your first post is not very clear, it looks like you have two distinct requirements :
- Add a write action to the monitor workflow so it will collect performance metrics in the DB/DW : not possible. However, what would work is creating a custom datasource module type with your script, then use it as the datasource in the monitor type as well as in a performance rule (with an additionnal performance data mapper at the end of the workflow to convert the property bag to performance data type).
- Run a powershell script after the monitor changes state, using data in the property bag. This is possible with a PowerShell Recovery Task and using the following syntax for the variables : $Data/StateChange/DataItem/Context/DataItem/Property[@DeezNutz =’PropertyName’]$ . More about this here : http://archive.wmug.co.uk/wmug/b/aquilaweb/posts/passing-data-items-to-recovery-actions