Global layers are currently implemented as an editor feature - by the time it launches the runtime, all overridden layers are replaced with normal layers that copy the global layer. So it's not currently possible to add a global or overridden layer at runtime.
Since your project likely has a fixed number of global layers, you probably don't need dynamic layers anyway - just add the global/overridden layers in the editor and make them invisible if you don't need them.