Extension of standard operator
Okay, after many time of research I found a quite enough answer on my question. I rephrased what I want and made the following things.

Custom operator

First I created a custom operator. It looks like this:

class SaveFile(bpy.types.Operator):
    bl_idname = "my_wm.save"
    bl_label = "Save My File"

    def __init__(self):
        print("It is working now")

    def execute(self, context):
        try:
            bpy.ops.wm.save_mainfile()
            print("My code!")
        except RuntimeError:
            print("ERROR: Can't save file!")

        return {'FINISHED'}

    def invoke(self, context, event):
        return self.execute(context)


After that I registered it:

bpy.utils.register_class(SaveFile)


Invocation

In the places, where I want to execute my custom code, I use this:

bpy.ops.my_wm.save()


Hope that it will be helpful for somebody else.