With the Voyager 1 spacecraft approaching the solar wind termination shock, much emphasis is put on numerical models to simulate the physical parameters that can be expected at and beyond the shock. This work emphasizes the modulation of cosmic-ray electrons in a realistic, nonspherical heliosphere; e.g., the effects on electron modulation of a poleward elongation of the heliospheric boundary and shock, as well as an irregular shock geometry, are studied. To achieve this, a new two-dimensional time-dependent transport model is developed including the major modulation mechanisms with a realistic, asymmetric heliosheath and heliopause. Because the mutual interaction of the solar wind plasma and the interstellar medium defines the geometry of the heliosphere, a 3-fluid two-dimensional hydrodynamic model is used to calculate the geometry of the heliosphere (location of the termination shock and heliopause) as input to the transport model. We find that changes in the geometry of the heliosphere caused by solar cycle-related changes in the solar wind speed influence the electron distribution significantly close to the shock and to a lesser extent in the heliosheath and inner heliosphere, but only if there is a significant amount of particle drift present. These effects decrease toward solar maximum when the heliosphere is expected to be diffusion dominated and also for low-energy (<30 MeV) electrons, where drift is not important. The model is also utilized to study the effect of possible nonspherical, irregular incursions in the termination shock geometry on the distribution of cosmic-ray electrons in the shock's vicinity. It is shown that these incursions only affect the electron distribution close to the termination shock and to a lesser extent in the heliopause and are highly dependent on drift. Furthermore, a time dependence and/or incursions in the shock geometry could account for the sudden increase by up to a factor of $4 in the low-energy electron intensities measured by Voyager 1 with the spacecraft still, e.g., $2 AU away from the shock.