Before we get to the actual script, you'll need to open Firefox's profile manager and create a new profile. Open a new Terminal window and type this:
/Applications/Firefox.app/Contents/MacOS/firefox -profilemanager
...then hit Return. This assumes that Firefox is in the Applications folder; if you have it somewhere else, change the path to wherever you put it. When the Profile Manager opens, click Create Profile, and name it whatever you want (I used "Clean"). If your profile name is longer than one word, make sure you use underscores or dashes instead of spaces. Once you're done, click Exit.
Now for the script. Copy and paste this into Script Editor:
on run
set ffPath to "/Applications/"
set ffName to "Firefox"
set ffProfile to "clean"
set findFF to "ps -ef | grep firefox | grep -v grep | grep -v sh | awk '{print$2}'"
set pinfo to do shell script findFF
set oldPnum to count words of pinfo
if oldPnum is less than 2 then
do shell script ffPath & ffName & ".app/Contents/MacOS/firefox -P " & ffProfile & " &> /dev/null &"
end if
set newPnum to oldPnum
repeat while newPnum = oldPnum
delay 0.25
set pinfo to do shell script findFF
set newPnum to count words of pinfo
end repeat
if newPnum is less than 2 then
set ffPID to word 1 of pinfo as integer
else
set ffPID to word 2 of pinfo as integer
end if
tell application "System Events" to set frontmost of every process whose unix id is ffPID to true
end run
[editor adds: I have not tested this hint.]

