Automatically fix polylines with ends with acute angle artifacts.

I have a layer containing polylines (roads). Many of those polylines have, at one end, a smallish 5 to 25m segment, not following the overall bearing of the polyline. It forms an acute angle. I'd like those annoying segment automatically removed. Manually, I'd split at the vertex with the acute angle and I'd delete the small (unimportant to us) segment.

Here's attached some images to explain.

Is there a tool or a script that can process a bunch of polylines and remove all those "artifacts" with an acute angle? (ArcGis 10)

I've started to write my own code. I'm new to ArcObjects. Anyone with some code samples that could help manipulate polylines, iterate through vertices, find angles between points and calculate distance between points?