Ok, I think I have finally got the bugs worked out and got the command working with blocks, it will also now convert lines into plines before converting, in case you have exploded leaders. I have attached the code (there are remarks by the items that are to do with our standards, so that you know what they do and can change them.
Let me know what you think, I am sure the code could be optimized, especially given all of the outside code and such that has been plugged into it, but it does at least work.