Block-triangular matrix algebras and factorable ideals of graded polynomial identities