Update proe-snap.py

Grouped code into functions and cleaned things up a bit to make it more readable.