Attempts to define tone types (e.g. rising, falling; mid, high, low) in terms of phonetic properties don't go very far, and crash when you try to devise rigorous criteria that apply to all tones within a language, in the same way for all languages (the strong sense of "same"). A falling tone is roughly one where F0 decreases within the syllable over time, and a rising tone is one where F0 increases within the syllable. From that definition, there are obviously no level tones in any language, because pitch goes up and down all over the place. Even if you filter out local variation by averaging F0 over evenly-spaced thirds of the syllable, there are still enough changes in pitch over these intervals that such "technically measured" level tones would be quite rare. (Two reasons for that are consonantal effects and pitch-coarticulation where an adjacent especially preceding syllable can influence a given syllable's F0 substantially).
A partial remedy for that would be to exclude syllable margins and look only at the central 2/3 of the vowel, then dividing that into subintervals. Of course, the odds of getting two means that are exactly the same are negligible, so you also need to add in a "significantly different" criterion, so that a 1 Hz drop in the mean does not define a falling tone, for example use a "2 standard deviations" criterion for deciding if two sub-intervals are "the same" or are "different". This is a potential approach to defining contour vs. level tones on strictly phonetic grounds. However: it has questionable utility, since there isn't much reason to think that phonetics actually cares about being rising, falling, or level – those are phonological concepts.
A "purely phonological" account would set aside phonetic properties entirely, and instead looks at how pitch functions in the grammar. The problem with such an approach is that what tone-types are about is some range of phonetic distinctions. When you claim that [tá] has the same tone as [dá], or that one utterance of the word [má] has the same tone as another utterance of the same word, you are claiming that the physical differences in pitch are not grammatically important, and they all instantiate a single concept ("H tone"). But you can't entirely disregard phonetic facts: it would be arbitrary to claim that [tá] has the "same tone" as [pà] or [kâ].
A phonological analysis can't be pure, but it can be minimally dependent on phonetic details, instead identifying the smallest / most revealing set of categories and operations. The common trend for H tones to rise somewhat (which could force a "rising tone" analysis on a language) and for L tones to fall somewhat (likewise imposing a "falling tone" analysis) would thus give way to a simpler theory: there are single phonological tones, H and L, and languages can have rules of phonetic implementation that spell out exactly what H or L means.
Under that kind of analysis, Mandarin's 4 tones can be analyzed as H, Rise (LH), L and Fall (HL), so only two tonal entities, and the 2 two-element combinations that H, L allow. The way this minimal phonological system is realized physically is then the domain of a phonetic study of tone in a language.
The best justification for a particular analysis of tones (esp. contours vs. level tones) comes from combination effects – the classical argument for deriving falling tone from a sequence of H plus L, argued for when a given morpheme has the tone pattern [pátà] in one context but [pât] in a context where the final vowel deletes. Unfortunately, such phonological evidence is not always available, and thus one may have to rely on formal combinatoric properties. (Northern) Vietnamese is a bit of a problem since it has 6 tones, but no non-arbitrary analysis into just 2 or 3 simple elements that freely combine. The main reason why an analysis of Vietnamese eludes us is that the language doesn't have morphological / morphophonemic processes which give rise to paradigmatic changes in tone, within a single morpheme. (The second reason is the dearth of generally-accessible information on the language. And I should mention that reduplication does appear to have some relevance for tone, but it's not clear what light that sheds on the question). I think the situation with Thai is similar.
I'm aiming to address the question of "identifying" contour tones. There is a tendency (not an absolute law) that rising contours have increasing F0 and falling contours have decreasing F0 (and level tones have steady F0), but the equation cannot be reversed, so you cannot conclude that a syllable with a measurable increase or decrease in F0 is has a contour tone. The analysis of Mandarin L-rising tone as being simply L is a case where you can't rely on pitch values to automatically provide the phonological analysis (and thus the third tone has been phonologically analysed as a low-register rise and as simply a L).
Given all that, there are a few things that could be said, in a separate narrowly-focused question, about crosslinguistic tendencies for various tones, as long as you accept a more minimalist phonological account of tone categories, as opposed to a bottom-up analysis that attempts to define tone types based on F0 measurements. (Hint)