The entity emission color will only have any effect if the material has an emission texture. Make sure your entity shows emission if you just set the color in the editor.
If the script still doesn't work, you can upload a simple map that shows the problem and I will take a look.