The way i'd go on this:
There are 120 stumpies on the battlefield, do you mean the 5 nearest to the cursor? To the focal point of the screen? 5 idle stumpies? All 120 are in a giant blob, shall I select the ones right in the middle and have them spend 10 minutes pushing their way out? Wait they're now in groups of 5 but there are 40 such groups onscreen, which one do you want to select?
syntax: select [integer_word|all|half|third|other_quantity_word] [location_word] [status_word] [...other filter word] unittype
example: 'select stumpy'
result: select all stumpies (quantifier defaults to 'all' if integer or some other quantifier is not provided)
example: 'select five stumpy'
result: select any five stumpies; which ones is undefined, user didnt specify = user doesnt care
example: 'select vehicle-lab'
result: select all vehicle labs
example: 'select idle factory'
result: select all idle factories of all kinds (basically factory here is a unittype tag that matches any factory regardless of what it makes, what faction, etc)
example: 'select five nearest contagious idle stumpy'
result: select five stumpies that are in a 'single block' (no other stumpies between them) that are closest to the mouse cursor and are idle.
... etc.
Come on, if EndWar can have this (maybe somehow different though), so can Spring. Just a case of writing up an appropriate command language (probably best used mod-specific, so i'd say leave this to Lua)