He says he's spending six days in Shanghai then flying to Manila for a half-day.
If his ticket Budapest-Shanghai-Budapest indeed leaves him in Shanghai for less than 144 hours, properly calculated per the rule, then he doesn't have to worry about pulling out the Manila ticket when checking-in at Ferihegy.
Indeed, maybe he doesn't even need to go to Manila at all!
Yes he does because BUD-PVG-BUD isn't a transit to a third country.
To clarify, he can do TWOV twice, on BUD-PVG-MNL and MNL-PVG-BUD but the itinerary BUD-PVG-BUD isn't eligible even for 24 hour TWOV.