I partially disagree with you. players should have any penalties if they went AFK for any reasons then came back. for all you know it could be the internet, parents being parents or the toilet. if they are repeat offenders (i.e. afking then coming back far too often for the game's length.) then there should be some punishments... (more on that later)
to avoid the disruption caused by afk, maybe have the afking player's units be controlled by circuit(or whatever the best ai is nowdays). circuit is better than most players who would go afk anyways so you can't really complain.
also can't the game detect the source of afk? i guess a reasonable idea for repeat offenders would be this:
- every time they go afk, a counter goes up. let's call this counter X
- every 20 minutes, X foes down by 1 (to account for stuff like tiolet breaks during a long game)
- going afk while the game is paused does not change the counter
- if they are assumed afk due to lack of ping, the counter does not go up (no pings means either the player lost connection, which isn't something they can reasonable control)
the punishments are meant to be subtle enough that the player will not be able to notice them, but it makes them either likelier to ragequit or make them be less of a detriment to the team
- if X is <= (lower or equal) 3 then no punishments
- if X > 3, every command has a 5(X - 3) percent chance of not registering (server-side so widget can't circumvent that) the odds of no register is capped at 40%
- if X > 7, 10(X - 7) percent of their income is shared the same way as excess, capped at 50%
- If X > 10, 10(X - 10) percent of units build during their AFK session will be kept in circuit's control, capping at 50%
- If X > 20, a !kick vote is started every time they go AFK(exculding ping afk) if they are kicked it will say "you are kicked for repeated afk"