What you need is already available to script this:
* Do short tests: parameter --autoclose N to close after N minutes (the 1st minute has no fee)
* Generate a different config for each test: just generate the JSON config, it's a piece of standard JSON
* Read the hashrate: the JSON output is perfect, or use --log then parse the file
and repeat repeat until you get the optimum.
Yes, i do understand this can be done the hard way but i was asking for an easy way that would come in a bat file with the miner for every user to test and then be able to report the findings for the git.