Play songs randomly and endlessly
It appears that the action Media &rarr; Music Play Dir cannot play files for infinite times. I tried with multiple Maximum Tracks value (with(out) Random enabled) and reached the conclusion that the maximum number of time Tasker would play a media would not be more than the number of playable files in the working directory. 

Enough about failure. Let's come to business. I came up with this following simple approach of mine:  

We're going to list all the files in your working directory (the same directory where your media files are kept) and store it in a variable. We will randomly select a file from the previous output, get the duration of the file, play it, set Tasker to wait for that much duration, then loop back to where the random selection of a media file occurs. 

Actions


Files &rarr; List Files:


Dir: working directory where media files are kept
Match: *.mp3/*.wma/*.3gp
Variable: %tracks


This step list all the files with MP3, WMA and 3GP extension available in the working directory, creates an array %tracks and fill the path name of each file as a value in that array.

I learned this step from this post of UncleMike.
Variables &rarr; Variable Set :


Name: %max_tracks
To: %tracks(#)


We're creating a variable named %max_tracks and assigning the size of %tracks array as its value. This variable would be used only in next step.
Variables &rarr; Variable Randomize:


Name: %rand
Min: 1
Max: %max_tracks


This step randomly selects a value in the range 1-%max_tracks and assigns the randomly chosen value to %rand.
Media &rarr; Test Media:


Type: Music File Duration Tag
Data: %tracks(%rand)
Store Result in: %duration


This step finds the duration of randomly chosen (%tracks(%rand)) media file and assign the duration as a value to %duration.
Variables &rarr; Variable Split


Name: %duration
Splitter: :


It is my assumption here that all of your media files are less than 59 minutes 59 seconds in duration. The duration received in last action is in the format MINUTES:SECONDS. In this action, we're splitting variable %duration at :. This would store MINUTES in %duration1 and SECONDS in %duration2.
Media &rarr; Music Play:


File: %tracks(%rand)
Stream: Media


This step plays the randomly chosen media file. 
Task &rarr; Wait:


Seconds: %duration2
Minutes: %duration1


This step makes the Tasker wait for the amount equivalent to the duration the randomly chosen would be played for.
Task &rarr; Goto


Type: Action Number
Number: 3


This step repeats the cycle from action 3 for the purpose of playing another randomly chosen media file.


Note: The Variable Randomize action of Tasker could bug you if the files are very short in numbers. That's something I can't help with.