Some discussion and references here: http://www.jehovahs-witness.com/10/67503/1.ashx
The Satan character does not belong to polytheism at all; at this stage there are only more or less benevolent or malevolent deities, no polar, absolute opposition of good vs. evil.
Interestingly, when the stage of monotheism (Yhwh is the only god = God) was first reached no Adversary character was implied either: God was presented as the source of both evil and good (Isaiah 45:7; probably against Persian dualism).
As Yhwh gradually rose from the position of one of the sons of El (cf. Deuteronomy 32:8f) to the position of the supreme El, chairman of the divine assembly, appropriating features of many other deities along the way, then a satan (common noun, meaning "adversary," in the special sense of "witness for the prosecution") appears as a functional title in the assembly (cf. Zechariah 3; Job 1--2). At this stage the satan needs not be always the same person (1 Enoch 40:7 still mentions several satans for different cases), and he is not an adversary to Yhwh-El but to the person under examination (Joshua or Job). His role in behalf of Yhwh-El can be compared to the different role of the lying spirit in 1 Kings 22.
Only in 1 Chronicles 21 (rewriting 2 Samuel 24) will Satan (anarthrous) become a proper name, taking charge of an action previously ascribed to Yhwh (inducing David to make the census) but now deemed unbecoming of the supreme god (God).
This trend will confirm in apocalyptic and Qumran literature where a number of embarrassing actions previously attributed to the god Yhwh (asking Abraham to sacrifice Isaac, Genesis 22, trying to kill Moses, Exodus 4, respectively in Jubilees 17:16 and 48:2ff) will be attributed to the Adversary (often called Belial or Mastema).
Only in Gnosticism will the Yhwh of monotheistic Judaism, creator of the world, be identified to an evil character (this is partly visible already in John with the "prince of the world" or the "Father of the Jews" as opposed to the "Father of Jesus" in chapter 8).