Yes, you can add gift cards to your onboard folio, but make sure you hold onto the cards. If you don’t spend all of the funds, I believe the difference can only be refunded back to the original gift card. No cash back; no crediting back to credit/debit cards.
The Budget Board here has all kinds of tips on scoring Disney gift cards at a discount. The usual three ways are to:
a.) buy gift cards off a place like Raise.com;
b.) buy them at Target with your Target Red Card for a 5% discount; or
c.) use a credit card that is generous with points or cash back to buy gift cards at a warehouse club like Sam’s or Costco, who usually sell the cards at a 4-5% discount. That discount, plus whatever rewards the credit card gives you, can give you an “all-in” discount of anywhere from 6-12%.
Good luck.