Code:
function Adept_OnEnterCombat(pUnit,Event)
pUnit:RegisterEvent("Frostbolt", 1, 1)
end
function Frostbolt(pUnit, Event)
local plr = pUnit:GetRandomPlayer(0)
if (plr ~= nil) then -- this text, the (plr ~= nil) that's how you actually do it, don't use if plr == nil, that doesnt work, just errors up :), atleast for me it does. also, remove this text before you start the script, it wont register but, just saying :)
pUnit:FullCastSpellOnTarget(39064,plr)
pUnit:RegisterEvent("Frostbolt2",2002,0)
else
end
end
function Frostbolt2(pUnit, Event)
local plr = pUnit:GetRandomPlayer(0)
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(39064, plr)
pUnit:SetCombatMeleeCapable(1)
else
end
end
function Adept_OnLeaveCombat(pUnit, event)
pUnit:RemoveEvents()
end
function Adept_Death(pUnit)
pUnit:RemoveEvents()
end
RegisterUnitEvent(80003, 1, "Adept_OnEnterCombat")
RegisterUnitEvent(80003, 2, "Adept_OnLeaveCombat")
RegisterUnitEvent(80003, 4, "Adept_Death")
Try using this one, it's the same.. Just removed some stuff that was not suppose to be there.
The things that were wrong were that you added a :RemoveEvents() on the function, wich made it **** up.
And when you register Frostbolt on the OnEnterCombat, you wrote 1,1, wich means it will cast directly, but only once.
Tho i edited now, so it should work.
The RemoveEvents() ****ed it all up, because it had no reason to be there 
Tho you could also do this, instead of making two frostbolts that are the same, you just do this.
Code:
function Adept_OnEnterCombat(pUnit,Event)
pUnit:RegisterEvent("Frostbolt", 2002, 0)
end
function Frostbolt(pUnit, Event)
local plr = pUnit:GetRandomPlayer(0)
if (plr ~= nil) then
pUnit:FullCastSpellOnTarget(39064,plr)
pUnit:SetCombatMeleeCapable(1)
else
end
end
function Adept_OnLeaveCombat(pUnit, event)
pUnit:RemoveEvents()
end
function Adept_Death(pUnit)
pUnit:RemoveEvents()
end
RegisterUnitEvent(80003, 1, "Adept_OnEnterCombat")
RegisterUnitEvent(80003, 2, "Adept_OnLeaveCombat")
RegisterUnitEvent(80003, 4, "Adept_Death")
That makes it way more simple, instead of making two functions that are exactly the same, now she will just cast frostbolts all the time, 
Also, when you use nil values, you always place "else end end" after, i marked it in red... There are other ways to do, but if it's just a spell you can just do like i have done. 
A tip is, read some guides, tho the best way of learning is to read from other peoples scripts, take a look at some of mine, or maybe some of Stoneharrys, or halestormXV's, theres alot to learn