The purpose of the script is for auditing schema changes on a database by using ddl triggers.
The first part of the script create the tables to store the data, a view to query the xml data of the trigger event and the third part create the ddl triggers.