SQL Server Management Studio adds the [ReadOnly] prefix to the window title for read only scripts. It also adds Debugging… and Executing… suffixes when SQL scripts are debugged and executed:
I’ve added additional processing for such titles that removes excessive text and adds appropriate status icons: