It looks like there's a change to that check that will be landing in 6.0, which doesn't really help you now, but just so you know.
As for the setting, I tried running this in Kibana's Console, and it worked for me. Are you sure you don't have something else enabled that might stop you from setting it (like Security)?
PUT /_cluster/settings
{
"transient": {
"script.max_compilations_per_minute": 40
}
}
Otherwise, it looks like Kibana only supports inline scripts, so indexed and file based scripts are out. And as far as I can tell, there's no way to use parameters with inline scripts in Kibana either.