It would indeed be pronounced as a velar (i.e., as ṅ) if it were followed by k, kh, g or kh. There is an inconsistency in different editions as to whether sangha, for example, is written as saṅgha or as saṃgha.
In fact even though /˜/ is supposed to be the sound, the places where aṃ, iṃ and uṃ would actually be realized as /ə̃/, /ɪ̃/ and /ũ/ are greatly outnumbered by those where it’s euphonically modified to accord with what comes after it. Sometimes the said modifications get reflected in the spelling (e.g. when the Thais write saṃyojana as saññojana), and sometimes not.