There is a difference between your two cases. When you are talking about a charge passing between magnets you are thinking of it as a uniform magnetic field. But it is not uniform, it gets stronger as you approach the magnets. if it were a uniform field the magnetic dipole you put in the middle would not feel a force along the line of the magnets, although it would still experience a torque.
To see where the force along the magnets comes from, imagine a single charge moving in a circle with velocity always perpendicular to the line of the magnets. If it were a uniform magnetic field the Lorentz force would act perpendicular to the line of the magnets producing an outward radial force. This is what you realized.
But really the field is getting weaker as you go away from the magnets, and since the magnetic field has no divergence that means the field lines must expand outward as you go away from the magnets. You see this on any diagram of the magnetic field of a dipole. So if you look at what the Lorentz force on the charge moving in a circle is now the the magnetic field has a (possibly small) component outwards you will see the charge picks up a force along the line of the magnets (in addition to the original force outward).
The method of poles is valid only when the magnets are far apart, because it replaces extended body by a pair of points and force between these points decays with distance as $1/r^2$. That is, when the points are close, the force becomes arbitrarily high. This does not happen with real magnets, because the poles are not really points and they cannot get as close to each other - mechanical contact and their rigidity will prevent that.
The general method for finding force between permanent magnets (applicable for any shape and position of magnets) is to calculate forces due to magnetic field of the magnet 1 on all magnetic moments composing magnet 2 and sum up those forces.
Mathematically, this means to integrate twice: first to get magnetic field B of magnet 1 at every point of magnet 2, and second to sum up over all elements of magnet 2.
Check out the formula for force $\mathbf F$ between two magnetic moments here:
https://en.wikipedia.org/wiki/Force_between_magnets#Magnetic_dipole-dipole_interaction
For highly symmetrical arrangement this can be integrated by hand, but much easier and more general is to write down a program that calculates the integral numerically. There may be some software available which does that, but if you are not familiar with it and do not plan to do this routinely, chances are it is more valuable to you to write the program yourself.
One possible method for sampling the magnets evenly is the Monte Carlo method; enclose both magnets in as small imaginary rectangular box as possible and then repeatedly pick pairs of points (one in each box) with each having uniform probability distribution in its box. When point happens to land inside a magnet, use it to calculate contribution to net force using abovementioned formula. Magnetic moment of a point should be chosen such that
$$
\text{number of points used to represent the magnet}\times\text{magnetic moment of a single point} =
$$
$$= \text{total magnetic moment of the magnet, which is usually magnetization} \times \text{magnet volume}.
$$
Best Answer
Equations for magnetic interactions between objects tend to be a lot more complicated than for electrostatic forces. This is because while electric fields are produced by and exert forces on charge, a scalar, magnetic fields interact with electric currents, the flow of charge in a particular direction, which is a vector quantity. This makes the equations for calculating a magnetic field inherently more complicated, as they depend on the direction as well as the magnitude of the current. In addition to this a current is always a flow of charge from somewhere to somewhere else, so you never really encounter a "point current" in the same way as a point charge.
The equivalent to Newtons Law or Coulombs Law for magnetism is the Boit-Savart Law. If you have a current $I$ flowing through an infinitesimal length $\mathrm{d}\vec{l}$ then the field at a point $\vec{r}$ is given by \begin{equation} \mathrm{d}\vec{B} = \frac{\mu_0}{4\pi} \frac{I \;\mathrm{d}\vec{l}\times\vec{r}}{|\vec{r}|^3} \end{equation} The field does still drop of with the inverse square of the distance, but the vector nature of the current makes the formula rather more complicated. Generally this expression has to be integrated over the length of a wire carrying the current. This can get quite complicated and so this method is generally only used for simple situations such as the field around a magnetic dipole. Having found the field, the force on a infinitesimal length of current can be found from. \begin{equation} \vec{F} = I\;\mathrm{d}\vec{l}\times\vec{B}\end{equation} This is again analogous to the electrostatic case but with added complication due to current being a vector.
Magnetic materials can have a wide variety of properties and the shape of the object also has a significant effect on the fields in and around it, and so on the forces it experiences. There are general methods for finding the force on an object due to an applied magnetic field, but not simple formulae.