To put the sword back and re-seal the demon in its prison, stand near the stone and drag-and-drop the sword onto it when it glows. You probably don't get experience points after the first time you defeat the demon, though I didn't try that.