Switching from shared Apple ID to Family Sharing - will we lose app data?
I also shared my Apple ID with my wife for app purchases, and found the transition to Family Sharing painless. This Apple support page goes into details, and I'll answer some of your specific questions below. 

What will happen to her existing apps, some of which have saved local data?

Most likely your wife's iPhone is set up so that iCloud (Settings > iCloud) is using B's Apple ID, and iTunes &amp; App Store (Settings > iTunes &amp; App Store) is set up with A's Apple ID. This makes the transition easy, but just in case please make a full encrypted backup with iTunes. 

On your wife's iPhone, go to Settings > iTunes &amp; App Store > Apple ID and click "Sign Out", reboot the iPhone, and then sign in with your B's Apple ID. A should then create the family group and invite B to the group. 

The existing apps might still be marked as "purchased by" A. If my wife wants to update them, she'd need to enter the A credentials

The linked answer describes how app authentication works when there are apps purchased under multiple Apple IDs on the same device. The authentication process for Family Sharing works differently. 

Under Family Sharing, account B's credentials will be valid for purchases shared by other family members if she has been flagged as a Parent/Guardian by the Family Organizer. This includes apps, music, movies, and iBooks. To download apps made by other members, open the store app that you want to download content from, and go to the purchased page. On iOS devices this is located at: 

App Store: Tap Updates > Purchased.
iTunes Store: Tap More > Purchased.
iBooks: Tap Purchased.  

The only time that a purchase needs to be authenticated is when a child that has be set as "Ask to Buy" tries to make a purchase.