It would be easy, I'm not in ACE atm but I can give you an idea of what to do: Figure out how to check if a character is in the main party (pretty sure it's in one of the pages for conditional branches) . If they are in the party then add their level to a variable. Once you have found all the party members and added their level, you then take the average.
To expand briefly on lohenien's post, make sure when you add their level to the variable, that you also are adding 1 to another variable each time to give you the total number of actors contributing to the average, which in turn gives you the number to divide the total level amount by.
When you use force action you need to choose a character or enemy that is "using" the action, in this case DM is the (D)ungeon (M)aster character that I use for testing purposes. Any character could be used to force the skill use because their skill does not have any variables that use character stats.
So what would this sound like in a sentence to a non-computer? Pardon me if that sounds stupid or snobbish but I just want to learn how to think like the program when reading certain functions while I make events and maybe just maybe learn a little scripting myself:
What is it saying in your common event where you have the conditional branch variable random== 0 sandwiched in a loop? Why did you loop this inside of the conditional branch of the variable random== >1?
Is it supposed to be breaking it back down to 0 after calculating character levels?
I wanted to add something for anyone who tries to use this trick. Be sure to have it placed before any other special events in a battle. Make sure if you want other common events to function that may affect characters or enemies that you have the level scale event occur first.
I just spent 15 minutes figuring out why the level scale common event was blocking my other event, which was set to change an enemy state, from working properly. Have the level scale occur first then on the next page, do whatever you planned normally and everything should work fine.