Can you double check that you have correctly install SM2? you should have it in your Plugins folder. If not follow the instructions given when you purchased SM2, and you should have the PackedSprite.cs file under Plugins/Sprite scripts/ in your Project view.
It could also be a problem with this script and where it is in your project, since PackedSprite is a cs file and your script is in js, there are some considerations to be aware of. Try to write this script in cs and see if it pass.
SM2 works with JavaScript, but you have to make sure the SM2 files are where they are put when you originally import the package. That is, all the scripts are grouped under the "Plugins" folder. Also, make sure your own JS scripts which call SM2 aren't inside one of the other "priority" folders like Plugins, Standard Assets, etc. If they are, then it defeats the purpose of having the "Plugins" folder, which makes sure the C# gets compiled before the JS.