There is no way to access the messenger of a command since the accessor is missing in the G4UICommand class.
What is use case? In most cases, UI commands do not need to access to the messenger class in which they are defined.