hciic.
We can help you learn to do this, but it is not as easy as you make it sound, and as you are seeing now, we can help you learn but we cannot learn for you, you are the one who must study and work hard to learn.
You will need to study and study a lot; it will take time so you will also need to learn patience.
Hoke's book is the first book to read if you are seriously wanting to learn, also dealing with waste, and situations to avoid in the safety section, guide to the forum, an welcome members in general chat, and the forum in general, if you do this you will get an understanding of how to recover and refine the metals we discuss, it will take time, and will be a lot of work, but without doing this you might as well just give the solution you have now to your friend at the laboratory and give up trying to recover and refine gold and just , forget about getting gold with chemicals.
The pins in your picture, I do not believe are as rich in gold as the man at the laboratory says, did you remove plastic? I would have, the picture is blurry but it looks like some steel rings on pins in your picture, I would have removed these, they also look to have plastic pieces on them, did you incinerate them before using nitric? I would have this would have also removed the oils, I would not have added magnesium, to remove nitric from the aqua regia, I also would have not added as much nitric as you did, but added HCl and small additions of nitric and heat to dissolve the gold, this way it would be much easier to remove nitric acid, I would use the evaporation method to remove excess nitric acid evaporating down the solution to concentrate the nitric and gas it off, when solution is very concentrated add a small amount of HCl and repeat two more times, a small addition of gold would be another way I would have removed the nitric acid.
The magnesium precipitated other metals from your solution, and you must have not have removed them all with nitric before aqua regia, as if you have brown and green powders now.
Let all of the powders settle, remove liquid from them, test the liquid with stannous chloride, if you get a reaction for gold in solution, I would add a copper buss bar and cement out the gold, from solution, any powders from this, put these with powders you are saving (rinse these well and dry them), after all of the gold is out of solution add iron to the liquid stir it well, then neutralize solution with lime, let iron powder settle and remove clear salt water, dry the iron powder, you can read more about this in dealing with waste.
The jar of valuable powder mark this jar, and save them.
Now you should read Hoke's book there is a free download in the book section. The gold will wait for you to learn, but without learning you will just loose your gold.