The aircraft flew on in LNAV or HDG SEL and at the MCP/VNAV altitude. If in LNAV and passing over the last waypoint the mode changed to HDG HOLD
A perfectly valid scenario, and one that puzzled me hasn't been elucidated upon more.. rather than all of this obtuse deliberate zig zag stuff.