Regardless of when/how Sparda obtained Yamato and when he sealed the true Hellgate, we know that Yamato was used to do the job. Just because the sword was used to seal the Hellgate, doesn't mean the sword had to be stuck there. Think of it as a lock and key scenario. When you close the lock, you don't leave the key sitting around in the keyhole, do you? No. Anyone could go over and open it up if you did that. We just know that the Order somehow obtained the broken Yamato (which Nero restored) and Agnus used it to open the Hellgate and let loose a bunch of demonic nasties. Unless further information and specifics of Yamato's history (who used it, when, where, etc.) are officially released by Capcom, your guess regarding anything else is as good as mine.