well I am a little confused by what you want to get done here but as long as you can determine which mode the game is in you should be able to display the appropriate UI panel. You basically need to have the game check if you are in debug or shipping then create the widget for the UI you want to be displayed. I don’t know when you want the UI to be shown if you want the UI to be shown very early like before or on a title screen then you need to toss a check in beforehand to figure out if you are in debug or not. This may be an issue if you want to show this UI right at launch as in during the splash screen of the game loading. I don’t know how to check or change anything that early on.
As for the code snippet you have there. You can accomplish exactly this in blueprints quite easily. Just create a new boolean variable and call it say bIsDebugModeEnabled then link the bool node to fire based on whatever way you want to fire it off like a custom event or something. You can link the results of the bool node to each UI. If true create the widget for the debug UI if false then create the widget for the shipping UI.
Your biggest problem is really figuring out WHEN you want this to be triggered. Making it pop 2 different UI widgets based on the conditions is as you can see very easy.
You should post some more information about exactly how you want this to work. Depending on when you need this to fire off I might even be able to just post a simple screenshot of the blueprint you need for it.