- standard temp & pressure are known
- on powerup record the local initial deltas
- poll the bme 280 in a loop
- when your estimate hits 400m, exit the loop and signal the motor
This is pretty quick and dirty, and if you're wrong about apogee may result in damage or complete destruction of the airframe.