1. Beat the game on any difficulty.
2. Start a second file.
3. Go to the file that you beat, and replay the battle with Darth Vader in Episode V.
4. Once Vader's beaten, go back to your new file. Your blaster will be gone, and you will have the lightsaber. Enjoy!
Please note that in Episode IV, there are some areas that require the blaster to continue. You won't be able to get past it with the lightsaber.
To reset the glitch, turn off the game.
Secret level - Finish the game, and in the level selection screen you will be able to pick a new, secret, level.
Level select - Finish the game.