Message seq reset script

Again, this code is very opaque and really difficult for me to understand what's going on here without context.