At least try to explain it, Crysist.
Sorry, I didn't know how. I just searched for it in another add-on, I'll try my best to explain it.
if(!$avatarCycler) checks to see if the global variable that we set equal to one has been set to one. We only set it to one once we added the keybind so it checks to see if the keybind is already there.
All the keybinds and their divisions are set to a global variable. One for their division or section
$remapDivision[$remapCount], one for the keybind's name
$remapName[$remapCount], and one for the function that keybind calls
$remapCmd[$remapCount].
Each variable is numbered for each section so the game knows which command goes under which section. After the keybind is set, the global variable for the number at the end of the keybind is increased
$remapCount++; so the next keybind can have its own section.
Square brackets at the end of variables allows you to add a number to the end of it, because you cant combine a variable and number like
%variable%n = "1";, you have to put it in brackets like
%variable[%n] = 1;, if
%n = 4; then variable's name would end up as
%variable[4].
if(!$avatarCycler)
{
$remapDivision[$remapCount] = "Name of the section of the controls list";
$remapName[$remapCount] = "Name of keybind";
$remapCmd[$remapCount] = "Name of the function";
$remapCount++;
$avatarCycler = 1;
}