simple.
dont turn the engine off with your foot on the pedal.
haha
but really, it sounds like you have an internal vacuum leak in the booster or a leaky check valve or poor grommet seal at the supply hose on the booster. also check for sticky pedal pivot or sticky or "rubbing on something" linkage problem, a booster to master cyl pushrod that possibly needs some adjustment (not enough clearance), binding linkage, a bad vacuum check valve or possibly a leak in your brake booster. some boosters have a return spring inside them that assists getting the pedal back where it should be. possibly that is weak or broken. if you installed a pedal return spring would that fix the problem? with a frame mounted booster there is a bit of linkage involved from the pedal to the master, usually. maybe start be checking all those pivots and bellcranks etc to ensure everything moves super freely. a bit of a tight spot in each joint, added all up, could be a lot of friction and possibly too much for the return spring to overcome.
try this
-with engine off, pump the brakes a few times to deplete the system of any vacuum in the booster. now, while holding brake pressure, start the engine. the pedal should drop slightly, like 1/4 to 1/2 an inch.
-next start the engine to build vacuum in the booster. then turn the engine off and do a couple of brake applications. the first should feel like normal and then consecutive applications should get firmer and firmer until they feel like manual brakes.
-now start the engine and let the vacuum build to normal. a minute of running should do it. step on the brakes and shut the engine off. the pedal should stay at the same height. if not check for a vacuum leak or possibly an internal leak in the booster or vacuum supply hose check valve. a vacuum gauge installed between the check valve and the booster would show what the booster is doing with the vacuum that should be stored inside the booster. you should have approx 18 in of vac on a normal engine when at operating temp.
just found this from roadkill customs. maybe help you?
https://m.roadkillcustoms.com/test-power-brake-booster/