I suggest another approach in SQL Server 2008.
Please try using Audits. They are under Security in SQL Serfver Management Studio. It takes just a few minutes to create. Then you can script them as you can script any SQL Server object
Create a New Audit, Give it a location, accept the default name or give it any other name.
On a server or database level create a new Server or Database Audit Specification.
Select Audit Action Type. As an example I have selected
Then I have enebled Audit and Audit Specification by right-clicking and selecting Enable.
As I test I have added a user to Master database and thenI have made him and then removed him from db_datawriter role. This has been recorded in a log. To view log, righ-click the Audit and selct View Audit Logs.
I have got something like this:
Date 10/1/2013 5:57:21 PM
Log Audit Collection (Audit-20131001-135447)
Event Time 17:57:21.7858782
Server Instance Name <my server instance name>
Action ID DROP MEMBER
Class Type ROLE
Sequence Number 1
Permission Bit Mask 0
Column Permission False
Session ID 66
Server Principal ID 272
Database Principal ID 1
Target Server Principal ID 0
Target Database Principal ID 0
Object ID 1
Session Server Principal Name <my domain name>
Server Principal Name <my domain name>
Server Principal SID 0x150000052100019818780122381183047672310502264300
Database Principal Name dbo
Target Server Principal Name <the user name for the person permissions changed>
Target Server Principal SID 0x16123417675321371476413335254015494208143
Target Database Principal Name <the user name for the person permissions changed>
Database Name master
Object Name db_datawriter
Statement EXEC sp_droprolemember N'db_datawriter', N'<user name>'
File Name <file path i have specified when creating the audit>.sqlaudit
File Offset 1024