You could do:
${Me.PctAggro}<90
Which will make it so that you sit if you are not being hit. If you are being hit then your aggro must be 100% so this should work. If aggro ever reaches 90% or more, you will stand up.
I would also do this to be safe:
${Me.PctHPs}>90
Sit aggro on low health is massive.
There are other things you might like too, for example this:
${SpawnCount[npc radius 15 zradius 10]}<1
That will check that there are no mobs within radius 15 of you. You could lower that to 5 or whatever is best. Personally I wouldn't bother doing this command at all though unless you are on an emulator or something. In real EQ the regen rate for sitting in combat is very low, maybe no better than just standing. Before they added the "out of combat resting state" then sitting in battles was worthwhile, but that was changed a long time ago in modern EQ. Also I seem to be the only one but I always set my characters to medstart=99 because I don't see the point of them not always medding whenever they are out of combat. The only problem is that if you are travelling somewhere and they are not full of mana, they will keep trying to sit to med. But I think it is good practice to med to full before travelling anyway, something bad might happen
If you still want to do it, here's another condition that is pretty cool:
${Me.TargetOfTarget.CleanName.Equal[!${Me.CleanName}]}
That says only do this if the mob the group is fighting is not me. Of all of them I would probably just go with the first one (the aggro check), and the HP check.