I usually scroll by keyboard, Page Up/Down, Ctrl+Home/End, and may even edit something, so the cursor is definitely not there anymore. For the case where it's just mouse scroll, I usually use @b4n's method. Although thanks for the suggestion.
Another hack I sometimes resort to is Undo, Redo, which brings me to the latest edit place. But I feel unsafe each time because of risk of not to redo something important. And again, I can't travel farther back than the latest edit. And the edit isn't always what I need, I may want to look at what I have been looking recently.
As for how it is best to implement the feature, I'm not sure, but some other editors done it somehow. I believe it is something like a timer that is reset on each cursor move which saves the position on timeout.