I've tried calculating a rolling window of edit distances between the alignments and then if the edit distance suddenly increases significantly then I know there is a frameshift. But I'm having difficultly setting a normalized threshold for a significant increase in edit distance that works on most alignments.
I think you are on a right track here, but I would look at alignments in general sense rather than local increase or decrease in distance.
Here is how I would do it in non-optimized fashion: 1) take two DNA sequences, translate, align and score the alignment; 2) remove one base at a time in sliding window fashion from your non-reference, translate, align and score; 3) do the same as in (2) but remove two bases at a time. If you end up with a better alignment (higher score) in either (2) or (3) compared to (1), that would mean that by removing a base or two you brought the frameshifted sequence back into frame. If (1) is the best score, that would mean there was no frameshift to begin with and doing (2) or (3) actually introduced one.
I am sure this is not a perfect strategy, especially if the frameshift is close to the C-terminus, but it could work with some extra thinking and optimization.