In short, this is used for static keys when used with UDP. For dynamic (TLS based) you do not need it.
My guess is that the shared secret is used to feed IV of hash function (MD5, SHA1, SHA224, SHA256, SHA384, SHA512), although I would have to inspect source code to see what is actually going on.
Instead of putting SHA1 to the outer package, I would prefer to keep it together with plain-source, than encrypt everything together. That would provide more security.
The drawback to this approach is the need to decrypt each packet, than calculate SHA1 to detect the "faulty" packet.