Nope. Nothing wrong with accessing your own data.
The timestamp value for 24 hours ago is time()-24*60*60. If you set a variable in PHP $yesterday=time()-24*60*60; you can use it to build your Mysql query.
ex: $query = "SELECT...WHERE...AND timestamp >$yesterday";
If you are working directly in MySql, the syntax is:
SELECT...WHERE...AND timestamp>(UNIX_TIMESTAMP()-24*60*60);
There are some timezone issues that I am ignoring here, but I will leave it up to you to add or subtract more seconds from "unix_timestamp()" to get exactly 24 hours worth of data.
Good luck with your banning effort. I found it to be a lot of hard work for little gain, myself. Spammers learned years ago to quickly rotate their IP addresses and domains to get around IP and domain blocking.
Might I suggest that in addition to WP-Ban, you add an anti-spam plugin like Akismet, add a security question or captcha to your comments via a comment or contact plugin, and possibly install another gatekeeper plugin like Bad Behavior that uses a more heuristic method to find and block spammers before they get to your blog. This "triple-block" method is very effective on my own site.