I'm going through this scenario,
my 5.4 is bad and will be rebuilt, the shop will over-bore the cylinders by .20 or .30, at that point for about $700 I can buy flat top pistons but I'm undecided.
I am going to get different camshafts installed something that increases hp tq and mileage but doesn't require a custom computer tune.
the transmission was just rebuilt a few hundred miles ago and had a mild shift kit installed, a small but noticeable change.
while the engine is gutted there isn't much else you can do to it, you can port and polish the heads, but that's expensive, you could do some research and see if the p.i. heads will fit your engine. (that stands for the improved performance heads ford came out with on some vehicles)
and the crank could be balanced, on the out side one could improve a smidgen more with the gott's mod, intake, MAF, exhaust, under drive pulleys, and elec. fans, and E-3 plugs.
with the over-bore, camshafts, and "outside" stuff listed above, and If you ran high octane pump gas and full syn. oil, you MIGHT get close to 400 hp at the flywheel.
with pistons add maybe 10-15 hp, crank balance adds 1-3 more if any, and port/polish adds another 10-15.
total cost for what I'm having done, $4700 and I get another 200,000+ miles of driving. with 350 horses at my mercy