For those getting the error on line 506, firstly, insert this after line 266 (the "foreach" line):
print("Line: $line");
When it fails, you can tell what line it fails on. Here's the problem...
In the newer configs, the network objects defined under the object-group are "network-object object OBJECTNAME". The script is looking for "network-object host OBJECTNAME", even if the object is a network.
Objects defined as ranges don't work. And nested groups don't work.
Also, in the access-lists, "object" must be changed to "host", and lines that begin with a service "object smtp" need to be reformated to something like "permit tcp host whatever host whatever eq 25" so the port is at the end. They can only begin with a service if it's an object-group.
I manually fixed a config, and it took some time. But, with the addition of the print statement above, I was able to tell where it failed.
If anyone manages to fix the script, please post an updated version. The email in the script for the original author doesn't seem to work.