How to pop up this command" object.modifier_add"
The string you type in the shortcut configuration screen is not Python code. It just happens to look somewhat similar to it. To run the operator as Python code, prefix it with bpy.ops, so bpy.ops.object.modifier_add().

However, it's better to not use operators at all, and use a regular Python function instead:

bpy.context.active_object.modifiers.new('operatorname', 'BEVEL')


See the documentation for more info on all the operator type names. This function returns the new modifier, so you can set properties on it directly.