Finder script from OS 9 to OS X

I have an old OS 9 applescript to determine if a given application is running.
Could someone give me some guidance as to what the equivalent script would look like
in an OS X environment? Thanks.
The old script is:

on run
if (isRunning(“LXR”) is false) then
quit
end if
end run

on isRunning(AppName)
tell application “Finder”
set runningApps to “About this Computer”
end tell
set numberOfApps to count of items of runningApps
repeat with i from 1 to numberOfApps
try
set nameOfApp to name of item i of runningApps as string
display dialog nameOfApp
if (nameOfApp contains AppName) then
return true
end if
end try
end repeat
return false
end isRunning

Kelsey

This works in OS X 10.2

tell application "System Events"
	if name of every process contains "TextEdit" then
		beep
	else
		beep 2
	end if
end tell