Yes, I’d write in. Not sure if this 12-minute line the gate agent told you is real or not (I have heard gate agents announce doors close 10 minutes prior). Regardless, in my book they should not leave early when it’s the last flight of the night and they are still waiting on connecting pax. Perhaps they had written off you making your connection but you really hustled to the gate.