First, I don't know nothing related to OTs, but I do know some Lua to help.
The following script replaces "protectionLevel=SOME_NUMBER", for "protectionLevel=123321"
local filename = 'huehuehuehuehue.br'
function writeit(value, var, num)
local f = assert(io.open(filename, "w"))...