I hope you have the full version, then you can use different objects for indexes and ions.
The idea would be letting the program read the table from left to right.
Add the ions and indizes and brackets to a family. Set their origin points to somewhere on the left edge for best results. Assign a family variable called charge. For ions set it to their corresponding charge. For indexes and brackets set it to 0.
Now you could do a for each (ordered) for that family to read from left to right. Create an invisible box that marks your playing field and do an overlap check or restrict the allowed x and y to only catch stuff in the playing field.
So it goes from left to right, you read the charges from the family instance variable. You need to add the logic behind the brackets and indizes to your reading logic. You should end up with the charge of the expression when you do it right. You might want to also check if the ions/symbols are near enough to each other (correctly aligned)
Another approach would be the indizes and brackets snapping to ions and they directly influence the charges of the ions. Then you just select all ions that are in the playing area and sum up their collective charge. Etc. Many different solutions thinkable.