Vim-tabspaces is a project mainly written in Vim Script, it's free.
Automatically set no(et) based on simple buffer analysis
Set et/noet automatically when changing buffers.
Defaults: au BufEnter * :call TabSpacesDetect()
If this is too slow for bigger files, you could probably get away with: au BufReadPost * :call TabSpacesDetect()