There is, but its a bit roundabout and I believe it’s a bug that you cannot reference the name using your method. You should post a bug report on Answerhub about it.
The GetScalarParameterValues node can get parameter names from a constant material instance, not a dynamic one. So while it may be a pain in the ***, you need to use a material instance constant, rather than a base material, on any objects you want to create a dynamic material instance from, as in your post. Or, you need to create a variable map(I just noticed this in 4.15, you can now set this like you would set a variable as an array) between base material names, and a material instance constant derived from it.
If the dynamic material instance is derived from a constant one, you can first call get parent, which returns a material interface. Then cast that to a material instance, and use a GetScalarParameters node. Since the constant and dynamic material instances have the same names, you can use the array of names from the constant one to access the values of the dynamic one.