Concentration duration spells end when your concentration does, so yes, if you take another standard action (or cast another spell as any kind of action), detect magic ends, as well as if you take damage / trip and fall / get thrown from your horse and fail your concentration check.
For spells with a casting time longer than a single action, you do have to maintain concentration the entire time you're casting it, so spells like summon monster can be interrupted if you get hit any time during the turn(s) you're casting the spell, not just in reaction (by readied action or attack of opportunity) to beginning to cast. Of course, those methods work too, against basically every spell.
Flaming sphere specifically isn't a concentration spell. The move action to direct the sphere can't be interrupted, and not taking that move action doesn't end the spell. Dying doesn't end the spell, although it makes it much less useful since you can't direct the sphere to move while you're dead.
TL;DR: There are three main times to worry about concentration and being interrupted. When you begin casting almost any spell, when readied actions and AoOs can interrupt it. While you continue casting the spell, for spells that take longer than a single action to cast. And while you maintain the spell, for spells whose Duration entry specifically mention concentration. Other spells don't require concentration to maintain their effects and being hit or doing something else doesn't end them, even if they require actions to use (like flaming sphere or call lightning).
PS: It's probably worth mentioning that the most common concentration check, in my experience, isn't one of the main three in this answer. The most typical concentration check for me is the check to cast a spell defensively, to avoid provoking attacks of opportunity (and much harder concentration checks in the form of damage and combat maneuvers).