The Revit API has changed since September of 2019 when that was posted.
As such several of the API calls in that script will need to be reworked for a modern Dynamo release. Best to incorporate the Python method you’ve tried into your new topic here as a result: Auto dimension with Dynamo