(Disclaimer: I didn't test this function, nor do I know much about $insong)I think the real clue here is the fact that you mentioned the two values were not always equal to each other. This implies that one of these values is an approximation, or they both are (but I doubt that). Now, the one approximation I know to get song length is to multiply the bitrate by filesize (or some similar formula, don't quote me on this). I'm guessing, for a variable bitrate file, mIRC will take the "first" bitrate is sees, thinking it is the only one available (in other words, mIRC does not recognize VBR files) and multiply it by filesize to approximate the song length. This explains why the difference is so large for VBR files.
I'm not quite sure which one of those $identifiers is doing the approximation, but I'd bet it would be the $sound().length, since it seems to only read the file, and not actually load it.
Assuming I'm right, this would not be a bug, but a limitation by design-- and there really is no better design for an approximation that uses a bitrate to calculate size (You really can't sum up all the bitrates in a VBR file). Again, assuming I'm right, Khaled's only option to fix this would have to be to use a more accurate length measurement formula.
And remember, this is just my theory of your scenario, I could be way off, so don't bitchslap me about this post