You have it right. If you want it to run every half hour from 13:00 until 17:00 but not at 17:30, I would write the cron entries like this:
# foobar.sh runs weekdays at the top of the hour from 13:00 through 17:00
# it also runs weekdays at the bottom of the hour from 13:30 through 16:30 (not 17:30)
0 13-17 * * 1-5 foobar.sh
30 13-16 * * 1-5 foobar.sh
IMO comments are key to preventing someone from misunderstanding the crontab entries. (that someone is often yourself a few months after the implementation, when many of the details are forgotten)
With a(I originally had example shell script, having it test for code that would detect being invoked at 17:30 and exiting can be pretty simple:exit. However the question specifically excluded this approach, and a number of criticisms were also made in comments, so I've removed the example as not relevant to the question)
# the cron entry will run this script at 17:30, but that's not desired
hhmm=`date +%H:%M`
if [ "$hhmm" = "17:30" ]; then
# output something about the time being the cause of the exit
exit 0
fi