You can (and, in most cases, must) use your onboard account for everything purchased onboard, including excursions, tastings, adult dining, and items from the shops. Tips are also charged to your account, as is any additional gratuity you choose to add by going to Guest Services. You can apply a Disney Gift Card to your account by going to GS. The only costs for which you don’t the onboard account while on the ship are cash tips to room service. (I think if you are getting beverages or other room service items that have a cost, you can put the tip on your account when you sign for the charged, but I have not done that.)
So, yes, your plan should work. You may want to check what has been charged to your account and present gift cards only up to that amount. Keep in mind that refunds (if, for example, an excursion is cancelled at the last minute) will be applied to the card used for the original charge, so be sure to save the gift card(s).