Length of what? You need more functions and the result is less flexible. In fact yours is a different suggestion. In my post above you pick an index that corresponds to an arbitrary element; you then apply two functions. You use two part functions with which you make into a pure function and then use MapIndexed. Using a different name for the list of entry choices (elements) there are fewer symbols in the first post than in yours as well.
More importantly, I suppose that the original poster wanted to be able to choose either random entries from each row, or elements that needed to be given in an additional vector. If the thing is just supposed to do what you suggest, why don't you simply use
Diagonal[m]
Cheers,
Marco