I am afraid more often then not the Steam version will have a kingdoms.exe file as well - it will however be a exact copy of the medieval2.exe file. For the principle\reason see here.
If it's not too difficult to implement then one way to check the version (disk or steam) will be to check the path. If it has 'common' before M2TW then it's Steam: ...\common\Medieval II Total War\mods\[mod name].
Another surefire check would be to test for the presence of the steam_api.dll file in the game's root directory.
Only reliable way is to look for an ico file in the complete mod installation - while highly unusual mine is not even in the root folder of the mod, it is in my file check custom folder (mods\[mod name]\verify) to keep the root as clean as possible.