That's why at the top it sets viewer.trackedEntity = undefined; This is custom per-frame code, you don't want the built-in per-frame trackedEntity code since it lacks a relative to aircraft's orientation option, it only provides relative to the Aircraft's ENU frame. I suppose Cesium will eventually have that built-in as well, but until then this should work. viewer.trackedEntity is simply a variable that the built-in code uses, you can make your own entity tracking variable for your own custom per-frame code.
The button should be modified to toggle the custom per-frame code, with a remove event listener and set transform back to Cesium.Matrix4.IDENTITY then set viewer.tracketEntity.
If anyone is interested I could improve upon it, some current problems
-Sometimes it crashes if there's no next point at the end of the path, in such cases one could use a previous point and reverse the direction.
-If you set -89 degrees pitch and the aircraft pitches down your heading can flip, I can fix that by making some more custom code rather than using .lookAt, or maybe flip roll for negative tilts after calling lookAt (not sure if that'll work though.)
Velocity is easily determined as well by determining the distance and time deltas between the 2 sampled points.