The dynamical screening of the electron-phonon vertex is due to the retarded oscillations of the electronic charge following the phonon annihilation into an electron-hole pair. This retardation induces a frequency dependence of the electron-phonon interaction that is commonly neglected. In this work I propose a dynamical perturbative expansion that, while being diagrammatically consistent, defines a controllable and physically sound method to include dynamical screening effects in the electron-phonon vertex. The method is applied to the phonon self-energy of the homogeneous electron gas where I show how retardation effects are driven by the ratio between the plasma and the phonon frequencies. I finally propose a simple approach to estimate the importance of dynamical corrections. This method is applied to the paradigmatic case of MgB_2 to show the non–perturbative and large retardation effects that characterize this peculiar material.