The Photoshop brush engine does not support changing the hardness of sampled brushes. I do not think that you can add that support with scripting.
You absolute sure ? I find it odd that it would only work with a few default brushes and couldn't be extended to all brushes.
You do not have to take my word on this. You should have been able to discover this for yourself. Choose any of the default sampled brushes, say one of the spatter brushes. In the GUI try to change the hardness. You will see that hardness is greyed out and you can not change it.
For the most part if you can not do something in the GUI you also can not do it with an action or scirpt. So I am sure that you will not be able to create a scirpt that will let you preview something that Photoshop can not do.