Could this be code to manipulate voting results? Looks like it's analyzing an entry and then comparing to to a couple of blocks and if it's larger/smaller/similar, then it performs a various task.
Could be a way to change votes if certain conditions are met. Not sure, though.