What is this StandardFirmata_ModifiedAll code doing?

Then If I do not understand how Arduino responds to a Firmata-formatted request to read a digital pin or set a PWM value or read an analog pin, how I could know at which part I must insert my code?

Do you understand, at the hardware level, what analogRead() is doing? Probably not. Does that prevent you from calling analogRead()? Absolutely not.

Do you understand exactly what Servo.write() is doing? Probably not. Does that prevent you from controlling a servo? Absolutely not.

Do you need to understand exactly how the Arduino, running a Firmata sketch, responds to a Firmata-formatted request to read a digital pin in order to call the Firmata function that formulates the request to read a digital pin? Of course not. You need only understand what APIs the Firmata library provides to your development platform, and have a general understanding of what those APIs are trying to accomplish. For example, if the development platform provides a digitalRead() method, you can be reasonably confident that that is not the method to move a servo, and that it is the method to read a digital pin. Exactly how that API formats the request that it sends, via the serial port, to the Arduino, and exactly how the Arduino parses the request, and exactly how the Arduino responds to the request, and exactly how the Arduino generates a response, and exactly how the Firmata library parses the response are not really things that you need to understand in order to be able to read the state of a switch connected to pin 8.

I am sorry for this very long and unconvenience question that might disturb you.

There is no need to apologize for asking questions. The answers to your questions, for the Arduino side, are in the Firmata sketch. How the API formats its request is not, but that can be obtained, if necessary, by visiting the Firmata web site - http://firmata.org/wiki/Main_Page.

I just don't think that understanding exactly how the Firmata sketch accomplishes a digitalRead() is necessary in order to alter a GUI that runs on another computer.