Advice on creating a Function

I set up some blueprint to enable the player to zoom in and out using the mouse wheel. I was wondering if I should turn it into a Function to help keep the event graph clean and if so, how?

While functions can be created manually, you can also select the nodes you want in a function (since you already have them), right click any of them and Collapse to Function. More on functions:

wondering if I should turn it into a
Function to help keep the event graph
clean

If the code is to be repeated or called from someplace else, then yes. One way or another you will end up with spaghetti. Managing script early will help keep things in check for sure.

Thank you!