What are the chances that I could get in trouble? Should I worry, and
is there anything I can do about it?
Receiving stolen property is a crime and using stolen information to acquire goods or services is a crime.
Whether or not you have legal liability comes down to whether you have the requisite intent to be guilty of the crime.
If you "know" that the gift card code is stolen, you are guilty of a crime.
If you accidentally or negligently use a gift card code that is stolen, you are very unlikely to be guilty of a crime.
There is considerable variation between states on the question on whether you are guilty of a crime when you do know for sure that the gift card code is stolen, but the likelihood that it is stolen is so great that your conduct amounts to be being reckless or to willful blindness.
You might also have civil liability on a non-fault based restitution theory for the purchases, if the gift card code turned out to be stolen, in an amount equal to the value of gifts that you received less the amount you paid for the gift card code.
The likelihood that you would be prosecuted or sued for an isolated instance of this conduct is very low. The likelihood that you would be prosecuted or sued for this conduct if you did it on a very systemic basis for profit, without doing any further due diligence into whether the cards are actually stolen, is considerable higher.
If you believe that the gift card codes are probably stolen, it would be best for you to refrain from purchasing them in the future.