Unfortunately the answer to this question is much the same as your last one. What you are trying to do is hard. Very hard. Creating this would be PhD if not postdoc work and doing it well could well win you a nobel prize. From the comments you've made in this and your other question you do not appear to be a specialist in either physics or chemistry, and thus as much as I hat to say this this is not something you can do at the moment. If this is really something you want to do getting a physical chemistry and/or a physics degree is the best way to go.
So writing something yourself aside let's have a quick look at the practicalities. To predict bonds you need to a accurately model electron density of wavefavefunctions. You can not just use simple Lewis Structure type models. So we need an initio or
DFT calculations. How practical would it be to use these in the type of program you are describing?
Unfortunately not at all. In order to predict bond lengths these systems work by optimising an initial system to find its lowest energy, performing a full quantum electronic structure calculation at each step. They are far to slow. For just one or two atoms they are reasonably fast, on my reasonably high end consumer grade PC they will run in a few seconds. The problem is that the scaling of these types of calculations is quite horrendous. The best scaling is DFT of Hartree Fock. These scale like the size of the system to the fourth power. So let's go from two molecules to say 500. Now instead of a few seconds were looking at just under 2000 years. Of course we can get round this using supercomputers, but that's hardly practical for a game (and there is still a limit, for example we can't really run full QM calculations on proteins). In order to model a visible amount of matter you would need on the order of ten to the twenty fourth power atoms. This is simply impossible to model.
Using classical force fields are also an option. These are much faster but will not model bond breaking and forming. Also by the time you get to visible quantities of atoms it will still be too slow.
Your best approach is probably to just forget about trying to predict bonds and instead just use a lookup table of something like A bonded to B has length X, energy Y, forms at distance Z with probability P and has probability P' of breaking. Obviously you can make A and B multi atom clusters to improve accuracy, but this will also make your lookup table much larger. Trawling the CSD would probably be the easiest way to get started.
Download a large number of CIF files, these contain information about what atoms are present in a crystal, where they are and how that are bonded. It's all just text so reasonably understandable. Iterate through them and calculate the average bond lengths for atom pairs. Bond energies tend to be on the order of a few hundred kJ/mol. You can probably approximate them as <a few hundred kJ/mol> plus some function of bond length. A 1/r type dependence seems reasonable but you'll have to play with it and see what works well (Incase it's not obvious we've left accurate modeling well behind now). As for capture distance, the sum of the Van Der walls radii is probably reasonable. Bond breaking probability can probably be approximated with boltzman style terms (that is $P_{break} = e^\frac{-E_{bond}}{RT}$, again the constants will require tuning to produce something that looks reasonable, -(E$_{bond}$ - E$_k)$ might work well on the numerator instead). Bond formation could be something like 1-P$_{break}$. You could also run quantum calculations for all possible pairs (or higher order clusters) of atoms or hit the literature to look up experimental bond strengths for greater accuracy.
Note the heavy use of probably, this will not produce anything remotely accurate or predictive, but with a bit of tweaking could look reasonable. You'll obviously need some kind of long range interactions as well (here an LJ potential plus some numeric integration to update positions and speeds each time step as in the other answers is probably what you'll want) and the check all pairs of atoms against the table to see if they bond. Tuning this will be all about making something that looks good in your game and is something you will have to do yourself.