I'm a little embarrassed to say I don't know why your method works, but it does seem to give the right answer. I'm sure the problem lies when you equate the equilibrium energy to $\frac{1}{2} k x_\text{eq}^2$, but I can't articulate it well.
A slightly better method (for the given potential) would be to complete the square. If you do this, you will see that the potential energy can be written as
$$U(x) = B\left(x - \frac{A}{2B}\right)^2 - \frac{A^2}{4B},$$
and you can easily see that this is basically of the form
$$U(x) = \frac{1}{2}k (x-x_\text{eq})^2 + U_0,$$
where $U_0$ is a constant for given values of $A$ and $B$. The addition of a constant potential energy does not change the equations of motion, and so this is a harmonic oscillator oscillation about the equilibrium point with a minimum energy of $U_0$, with a "spring constant" of $k=2B$, as you have found.
So far both our methods give the same answer. However, if you consider the potential $U(x) = -A x + B x^2 + C$, where $C$ is some constant, you will see that they disagree. Of course, the constant $C$ shouldn't change the frequency, and so your method can't be correct.
Doing it for a general potential
A more interesting question is how one could do this in general. Suppose one had an arbitrary function $U(x)$ (say the cubic function I've plotted below) how could one calculate the frequency of small oscillations around the minimum?

The method is actually quite nice. (I'm going to illustrate this with the function $U(x) = A x + B x^2 + C x^3$, though it works with any function.)
First, find the (local) minimum you want, using the standard methods. In my case, it is the point $$x_0 = -\frac{2 B}{3 C}.$$
Next, perform a Taylor Expansion about this equilibrium point up to the second order. The expansion about a point $x_0$ is thus:
$$U(x) = U(x_0) + U'(x_0) (x - x_0) + \frac{U''(x_0)}{2!} (x-x_0)^2 + \text{ higher powers of } (x-x_0)\,\,...$$
Since you will be expanding about a minimum, $U'(x_0)$ is zero, and $U''(x_0)>0$, so essentially all you need to do is find the double derivative of $U(x)$ at $x_0$. What this form means is that very close to $x_0$ the function $U(x)$ behaves as a constant plus a quadratic term. In other words, close to the minimum it looks like the potential energy of a harmonic oscillator! (Of course, this is only true for very small oscillations, i.e. when $x-x_0$ is very small.)
The last step is to realise that since you have approximated your function about $x_0$ as $$U(x) = U(x_0) + \frac{1}{2}U''(x_0) (x-x_0)^2,$$
you can compare it to an ideal harmonic oscillator and easily see (as I described earlier) that the "spring constant" is given by $$k = U''(x_0)!$$
This means that very close to the point $x_0$, this system behaves very much like a harmonic oscillator with this spring constant. In the example I've taken, this means that (curiously) $k = 2 B$ again. You can try it out with your example as well.
It might seem a little confusing to understand at first, but I hope you'll agree that it gives a very neat way to quickly find the oscillation frequency about any minimum of an arbitrary potential.