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)
(I originally had example shell script code that would detect being invoked at 17:30 and 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)