Do you want to distribute the Windows Installer 3.0?
IIWY, I would not uninstall the old version first. IMHO, Microsoft wouldn't be Microsoft if they would not succeed to update their Installer in a decent way.
I think you want to look for the key "KB893803v2" and the DisplayVersion "3.1".
The script is still as it is in the first post.