The Nival export has absolutely nothing to do with it (this is a Granny feature), and first you need to learn how to add the necessary attribute to the scene, and only then export this scene (and it doesn't matter whether it's through a script or from the program).
2. The MEL script for the editor is an instruction without which no GR2 export will work at all through the editor, and your script-instruction lacks a connection to the ExpSrcClip link that exists in the editor, and during export, it is simply not taken into account. In fact, it is precisely from the file linked by this reference that the attributes should have been exported, and you are again wrong – it does matter what you use to export, and your script is generally for Blitzkrieg 2 with one modification so that the Heroes editor would be compatible with it. The Blitzkrieg editor exports animations just like Maya (i.e., not as needed for Heroes), and when exporting animations, only 1 file is involved, not 2 as in Heroes.
For clarity, here's my old message about why you can't use transparency in animations due to the lack of the Nival export script.
/topic/at/1176545/