For verification, there is LinearFunctionQ in the Wolfram Function Repository. For the actual conversion of equations to matrix-vector, CoefficientArays is the recommended method (that is to say, it’s what we use in-house).
It handles expressions written with normal symbols x, y, … correctly
It does respect variables written as Indexed (say Indexed[x,1])
It does respect variables written as Subscript(ed) (say Subscript[x,1])
Hence your function is perfect (BTW: Is the source code available?).
My code may be overloaded, since it outputs detailed messages to tell the user exactly what is wrong with which equation. For simplicity, I think I’ll throw that out and use your function.