The first thing to consider is that a galaxy is almost empty space and the visible solid matter is a tiny fraction.
Here are some 'back of the envelope' calculations. Taking the Milky way as an example, it is estimated to contain approximately $3\times 10^{12}$ stars though estimates vary quite widely. A typical star has around 1/3 the mass and radius of our Sun. (The radius of a star is roughly proportional to its mass for some odd reason.) The combined cross sectional area of the stars is then:
$$\pi \left(\frac{R_{Sun}}{3}\right)^2 \times 3\times 10^{12} \ \text{stars} = \pi \left(\frac{700000 \ \text{km}}{3}\right)^2 \times 3\times 10^{12} \approx 6\times10^{24} \ \text{km}^2$$
The radius of the Milky Way is estimated to about 53,000 ly so the cross sectional area of the galaxy is approximately
$$\pi(53000 \ \text{ly} \times 9.5\times 10^{12}\ \text{km}/\text{ly})^2 \approx {8\times 10^{35}} \ \text{km}^2$$
The ratio of cross sectional areas of solid matter to empty space is then approximately
$$\frac{6\times 10^{24}}{8\times 10^{35}} \approx 10^{-12} $$
or approximately one trillionth.
This is the ratio looking looking from above the disk plane but from the side the visible matter is not distributed as a sphere but more as a flattened disk like oblate spheroid. This increases the effective cross sectional area of the stars by a factor of maybe 20, looking from the side of the disk, but the proportion of the cross sectional area of the solid matter remains almost negligible.
This means that a planet entering like a projectile (with greater than escape velocity) is unlikely to collide with any stars and will probably pass through our galaxy on a curved trajectory, a bit like comets usually pass through the solar system without colliding with anything.
There is an assumption here that the planet was not initially on a course heading straight at the black hole at the centre. What are the chances of that?
The object (Sagittarius $A^*$) at the centre of our galaxy that includes a black hole has a Schwarzschild radius of approximately $1.2\times 10^7 \ \text{km}$ and wider radius of around $7\times 10^{12} \ \text {km}$ that includes the accretion disk and close orbiting stars. If we take the larger radius, the ratio of the black hole cross sectional area to that of the galaxy is approximately:
$$\frac{\pi (7\times 10^{12})^2}{8\times 10^{35}} \approx 2\times 10^{-10} $$
which again, is almost negligible.
Now lets consider the case of a planet that drifts in with low initial velocity. It will tend to be drawn in towards the black hole at the centre and acquire significant radial velocity as it falls inwards, but it will also acquire a certain amount of tangential velocity from the sling shot effect if it happens to pass near some orbiting stars (and possibly to lesser extent from frame dragging) and if it acquires sufficient angular velocity it may avoid falling into the black hole and end up orbiting it in a precessing elliptical orbit. This effect is difficult to quantify, but as mentioned above, the density of stars is so low, that the likelihood of passing sufficiently close enough to a star for the sling shot effect to be significant, is small and the probability of the slow moving planet being drawn into the black hole would be high in this case.