The first 7 bytes of the server packet are 2 bytes size followed by 5 bytes encoded opcode.
The 5 bytes are a mix of obfuscated opcode as well as a static opcode.
For an example to help you visualize this, let say we have a packet of size 10, that's 0x0A in Hex.
The packet structure would look something like this {
0x00, 0x0A, 0x01, 0x02, 0x03, 0x04,
0x05, 0x06, 0x07, 0x08}
The code you posted essentially checks if the encoded opcode length is not less than 5 otherwise it's not a valid encoded opcode size and therefore could be malicious.
I personally don't think it's valid to use such code anymore from a security perspective as the packet structures are public as well as the static opcodes and methods to obfuscate it, publicity of this code defeats the purpose of the code you posted. It could still be useful in the case where you are receiving packets that are not correctly formatted.
Regarding pseudo packets, your code shouldn't be hitting this chunk of code unless you're running an unsupported game client on an unsupported emulator.. or you're sending incorrectly formatted packets to your server
Hope this helps.