• I didn't go through all your script however, you can shrink your log file using

    Use database name

    DBCC SHRINKFILE (logical name, 1024)

    If it didn't work first time, try couple of times.

    If it still does not work, then take log backup, then shrink, it should work then.

    SueTons.

    Regards,
    SQLisAwe5oMe.