generate an event or function callback when a stringproperty is changed via user interface
I suggest looking at the context properties, for instance in this example context.area.type.  If scene.x is changed in the console it prints CONSOLE, a panel in the properties panel PROPERTIES etc.  As a test, print the context.copy() dictionary to find what suits for your needs.

import bpy

from bpy.props import StringProperty

def goober(self, context):
    print(context.area.type)
    return None

bpy.types.Scene.x = StringProperty(update=goober)