Since you use a single cell to input both your data and formula, you should change your "formula" from =HOUR("17:30:00") - Hour("9:00:00") to simply
=("17:30:00" - "9:00:00")*24
The above formula will give you the desired result 8.5.
IMPORTANT. Make sure you format your cells as Number
( by going to: Format > Number > Number)
Another option (an expansion of this answer ...
1. Select A10:A20 > right click > Data Validation
Criteria = "List from range" > F2
2. Formula in cell F2: =mult(now(),1) " )
Is to create two cells, one with a tick box option (A3), and the one next to it (B3) with the "list from range" validation.
If you do that, then whenever you tick the box ...