Here's a "fix" for your code... doesn't change a thing in the code... just the way the "seed" for the RAND function works...
select dbo.fx_getrandomnumber(500, 300, rand(CHECKSUM(NEWID())))
FROM dbo.Tally
WHERE N <= 10
That will randomly generate 10 "different" integers with the understanding that it's the nature of random numbers to occasionally be duplicate in any set of random numbers.
If I may suggest, if you need to write that much code to use a function, you may want to consider not even using a function. Just do it "inline".
SELECT ABS(CHECKSUM(NEWID()))%(500-300+1)+300
FROM dbo.Tally
WHERE N <= 10
--Jeff Moden
Change is inevitable... Change for the better is not.