A few things here:
I'm not sure why you would want to return a 503 error. The bot still takes up some of the same server resources.
You should consider disabling session management (or at least minimizing session timeouts) for bots.
If you are trying to block bots, you should also be using robots.txt ( see http://www.robotstxt.org/ for good information about that).
Very likely you are already using robots.txt, but that should be noted for anyone coming to this page later.
The UDFs below are based on Ben Nadel's work. The data in it should be kept updated, though.
I might eventually do that following the pattern I used in my own SpamFilter.cfc. For now, though, the following pair of UDFs should get you started.
Note that my UDF treats CFSCHEDULE as a bot because I don't want to use sessions for it. If you want to block all bots, then you should remove that from the list.
<cffunction name="hasCFCookies" access="public" returntype="boolean">
<cfreturn ( StructKeyExists(Cookie,"CFID") AND StructKeyExists(Cookie,"CFTOKEN") )>
</cffunction>
<cfset request.hasCFCookies = hasCFCookies>
<cffunction name="isBot" access="public" returntype="boolean">
<!---
Based on code by Ben Nadel:
http://www.bennadel.com/blog/154-ColdFusion-Session-Management-Revisited-User-vs-Spider-III.htm
--->
<cfset var UserAgent = "">
<!--- If the user has cookies, this is at least a second request from a real user --->
<cfif hasCFCookies()>
<cfreturn false>
</cfif>
<!--- Real users have user-agent strings --->
<cfset UserAgent = LCase( CGI.http_user_agent )>
<cfif NOT Len(UserAgent)>
<cfreturn true>
</cfif>
<!---
High-probability checks
If the user agent has bot or spider in it, it is a bot
Some specific high-volume spiders listed individually
--->
<cfif
REFind( "bot\b", UserAgent )
OR Find( "spider", UserAgent )
OR REFind( "search\b", UserAgent )
OR UserAgent EQ "CFSCHEDULE"
>
<cfreturn true>
</cfif>
<!---
If we haven't yet tagged it as a bot and it is on Windows or Mac (including iOs devices), call it a real user.
If this results in a few spiders showing as real users that is OK
--->
<cfif REFind( "\windows\b", UserAgent ) OR REFind( "\bmac", UserAgent )>
<cfreturn false>
</cfif>
<!--- If we don't know yet, only figure spiders from a known list of a few --->
<cfif
REFind( "\brss", UserAgent )
OR Find( "slurp", UserAgent )
OR Find( "xenu", UserAgent )
OR Find( "mediapartners-google", UserAgent )
OR Find( "zyborg", UserAgent )
OR Find( "emonitor", UserAgent )
OR Find( "jeeves", UserAgent )
OR Find( "sbider", UserAgent )
OR Find( "findlinks", UserAgent )
OR Find( "yahooseeker", UserAgent )
OR Find( "mmcrawler", UserAgent )
OR Find( "jbrowser", UserAgent )
OR Find( "java", UserAgent )
OR Find( "pmafind", UserAgent )
OR Find( "blogbeat", UserAgent )
OR Find( "converacrawler", UserAgent )
OR Find( "ocelli", UserAgent )
OR Find( "labhoo", UserAgent )
OR Find( "validator", UserAgent )
OR Find( "sproose", UserAgent )
OR Find( "ia_archiver", UserAgent )
OR Find( "larbin", UserAgent )
OR Find( "psycheclone", UserAgent )
OR Find( "arachmo", UserAgent )
>
<cfreturn true>
</cfif>
<cfreturn false>
</cffunction>