This will set the level by the average level of the current active party, not including any in "reserve":
lvl = 0
$game_party.actors.each {|a|
lvl += a.level
}
lvl /= $game_party.actors.size
$game_actors[1].level = lvl
This will factor in reserve party members, but be careful that you don't have a bunch sitting at level 1, since it will greatly skew the average:
lvl = count = 0
(1..$data_actors.size).each {|i|
if $game_actors[i] != nil
lvl += $game_actors[i].level
count += 1
end
}
lvl /= count
$game_actors[1].level = lvl
Just put these in a script call.
For both methods, you need to replace the number in the brackets from the 1 to the ID of the actor you want to set the level of.