Try making a custom spell based off of Channel or an instant cast spell and when it is casted, create the units you want with triggers. Oh, and add a expiration timer for them. Not entirely similar but it should work.
I don't think I'll have the time to post a code or something for you but this is how the spell is coded exactly in DotA:
By the way, this is nowhere close to being a DotA forum. So don't expect everyone here to know what and how DotA spells are exactly. Many people here don't bother...