Hit or miss Revit connection?

I found a script online to add the width and length of a room to a room tag. It only works about 30% of the time. Can someone give me a clue about why that is? What do I need to do t o get it to function all the time?

http://www.revitforum.org/architecture-general-revit-questions/549-room-tag-overall-dimensions.html

Thanks

Matthew

What do you mean by 30% of time? Can you show us screenshot.