Is there a way to use the "battle frequency counter" as a variable? I want to have an audio file increasing in volume the closer the player is to a random encounter.
No, there was no command for that.
I've just added one: "get battle countdown", and "set battle countdown" too. (Wait for a nightly build.) I hadn't thought that there might be some interesting uses of those commands, like yours.