Which skin are you using ? Because I think this script is a little bit deprecated and all major skin use built-in Kodi function to work with smart playlist.
Sorry for my english, but, you know, I'm French so ...
Main HTPC : Odroid-C2 running CoreELEC with Titan Bingie
Secondary HTPC : Freebox Mini 4K running Android TV with Titan Bingie