Painless script with GeoShape type query

That's currently not supported, painless does not support spatial relationship methods so you cannot check easily if a geo_point is inside of a polygon. Maybe you might want to open a feature request in the Elasticsearch repository?