One Blueprint with Runtime and Editor functionality

How to resolve logic/code/build problem with this situation:

Blueprint Actor (custom c++ parent) which is in 99% used in Runtime.
But in special case (when in PIE someone click “Eject”) blueprint has special behavior.

In normal case I can create C++ Function with pragma “#if WITH_EDITOR” and problem is solved.
But my code must use module “UnrealEd”.
I can add this module dependency to Runtime.build.cs but then can’t build my plugin.
I can also add this code to Editor module, but don’t know how to call this code conditionally (in Blueprint or C++).

So simply I want to access conditionally to editor module function or can be access to variable only.

In plugin I don’t have any global actor, but Bluetility Widget. Maybe event ? But I need in tick in some cases access to this function/variable.

This specific editor function get current location and rotation of camera when eject.

Maybe my logic is wrong, not code ?