To vote, each member places a ring-shaped token over the dowel corresponding to their preferred candidate.
Not exactly (just to be a nitpicker :-) ):
- the tokens have different shapes (triangle, round, square) for the different candidates
- the voters covertly cast their token in a small jar
- after everyone has voted, the jar is broken, and the Maester's attendant puts the tokens on the rods
- Maester Aemon places his round token openly to solve the tie
(by the way, another difference with the books where Jon wins by a large majority, thanks to Sam's clever talks)
Did George R. R. Martin come up with this idea himself ...
George R. R. Martin came up with a different idea.
In the books, the vote works differently: the black brothers vote by secretly choosing a token representing one of the candidates, and then placing it in a large kettle. After everyone has voted, the Maester and his attendants tally the votes.
Most of the brothers were unlettered, so by tradition the choosing was done by dropping tokens into a big potbellied iron kettle that Three-Finger Hobb and Owen the Oaf had dragged over from the kitchen. The barrels of tokens were off in a corner behind a heavy drape, so the voters could make their choice unseen. You were allowed to have a friend cast your token if you had duty, so some men took two tokens, three, or four, and Ser Denys and Cotter Pike voted for the garrisons they had left behind.
When the hall was finally empty, save for them, Sam and Clydas upended the kettle in front of Maester Aemon. A cascade of seashells, stones, and copper pennies covered the table. Aemons wrinkled hands sorted with surprising speed, moving the shells here, the stones there, the pennies to one side, the occasional arrowehad, nail, and acorn off to themselves. Sam and Clydas counted the piles, each of them keeping his own tally.
A Storm of Swords - Blood and Gold, chapter 75 Samwell IV
While the vote in the series is somewhat similar (the use of tokens instead of names written on paper parchment), the "count by pile height" is an invention of its creator, probably to give the viewer a quick visual cue of the evolving situation, rather than having three different characters individually count each pile and double-check their results.
Note that for this tallying method to work the voting tokens must be specialized items, finely crafted to be inflexible and equally thick. And even then, it would be quite unwieldy with more than a hundred of voters ...
Practicability apart, it effectively makes for 20 silent seconds of suspence!
(GRRM's original idea of using common objects seems much simpler and more appropriate to the setting, in my idea)
... or is it rooted in history?
As DavidW wrote, a method of vote by placing different tokens in an urn was used in ancient Greece.
The books also have another aspect with a counterpart in the real world: after a few voting sessions end without electing a new Lord Commander, Stannis' soldier bar the door of the hall, so that the members of the Black Watch are forced to vote and vote again without any chance to eat, until a new Commander is finally elected. This is similar to what happened during the 1268–1271 papal election, when after many inconclusive votes the electors were given only bread and water, and the palace roof was removed.