If you can grab a Scene that's in the project you want to edit the Widget of, you can use it as a reference point to get the project object, then edit the widget from there.
I've tested this script out on a global keyboard shortcut. The widget was in an inactive project, but had a scene online that was from that project.
dim sc as xpScene
dim ofb as xpOutputFrameBuffer
Engine.GetOutputFrameBuffer(0, ofb)
ofb.GetSceneOnLayer(0, sc)
dim widget as xpCounterWidget
sc.Project.GetWidgetByName("MyCounterWidget", widget)
widget.Up
------------------------------
Zachary Fradette
United States
------------------------------