Technically, frames actually have a Depth property, but as most authors don't run 3D setups themselves, this property is rarely (if ever) used.
As for the UI dynamically adapting its depth to the game world, that won't be possible - the 3D game world isn't accessible to UI code, and there does not appear to be any flag for telling the game to dynamically adjust the frame's depth.
- - - Updated - - -
Didn't see the part about adjusting the entire UI. You could try the following, no guarantees:
Play with the value until you get something that suits you.