Ok, reread original post.
Point of order, I hate how stealth is done in most games. I hate that stealth is typically dex based. But assuming we are working in the normal D20 paradigm, and it’s a submarine vs. hunt.
PCs have a stealth heart, enemies have a stealth heart or 2.
Based on advantages of different technology we’ll say the RUS sub has a quieter running sub and USA sub has better passive sensors.
The Russian sub gets a d6 on stealth effort, the US sub gets d4 on stealth effort.
The Russian sub gets D6 on perception effort, the US sub gets D8 on perception.
A 20 on a stealth resets that sub to full heart stealth. (Enemy lost track or bypassed it)
A 20 on perception adds a d12 to the effort to find the Enemy sub.
A 1 on stealth, takes d8 from your stealth heart.
A 1 on perception, give the enemy sub d8 on stealth.
Not moving makes perception easy, and you do nothing with Stealth.
This assumes both parties know there is something there…just not sure where.
If enemy is at 10 stealth for 3 rounds…they gain a D8 temporary stealth points. PCs lost track. 6 rounds…another D8…
But once a PC is at 0 stealth for 3 rounds they get a negative 8 to enter stealth again. At 6 a negative 16.
The system outlined above is not perfect, but allows for mutual contested anything. I would not let the players keep track of their stealth effort (dm screen) and if they rolled a 1 perception I would roll behind the screen on my turn and tell that player hears or sees movement in a direction closest to them.
The dragon in the above example: should be waiting 4 rounds or whatever AI says and then wait to an opportune moment to attack…if he never saw or heard 2 of the PCs…he doesn’t know they are there.