I spent several years unemployed but with casual work coming in from time to time. Here's how it worked for me:
If, during any 'signing week', I worked for fewer than 16 hours I simply had to declare that work on the next occasion that I 'signed on'. The amount that I'd earned (less £5) was then deducted from my JSA. So, for example, If I earned £60, £55 would be knocked off my JSA. (In practice though they sometimes seemed to forget to do it; I didn't complain!)
If I worked for more than 16 hours in a 'signing week', I had to 'sign off' and then, after completing the work, 'sign on' again. JSA would be paid up until the day I signed off and then from when I signed back on. The really irritating thing though was that every time I 'signed on' I had to go through the same interview procedure that new applicants have to go through. So (because I would sometimes sign on unaware that I'd be offered work in the very near future) I sometimes had to go through the whole process three or four times each month.
As with all JSA claimants (with a recent full record of National Insurance contributions and irrespective of whether they're getting any casual work or not) you need to remember that you get 'contribution-based' JSA (which is NOT means-tested) for the first 6 months but 'income-based' JSA thereafter. That IS means-tested and if, for example, you've got a partner in full-time employment, you almost certainly won't get anything at all.
The other benefit which you could probably claim would be a discount on your Council Tax. I claimed it but it was a pain in the posterior to do so. That's because I notified the local council about my regular income (from JSA) but then had to write them a letter, to explain my change in circumstances, every time I got a bit of casual work. They would then write back to demand that I send them my bank statements for the past 6 months (despite the fact that I might already have submitted them several times over the past few weeks) and generate mounds of paperwork to reassess my Council Tax bill. I could well be writing to them about my 10th period of temporary employment while they were still calculating the figures after my 6th such period!