The first thing I notice is that there are a LOT of endif's missing. From the FormCalc reference: You are not required to have any elseif(...) or else statements as part of your if expression, but you must state the end of the expression with endif. (Emphasis mine.)
Also, towards the end (and this might be due to the lack of endif's) your function calculated the value of StartInterval, then sets it to 0. So, even if the rest of the function was working, that last bit would guarantee that the answer is always 0.
Next, this code seems to be calculating numbers from a table. Do you have your table set up the same way with the same field/object names? Or have you modified this script to match what you have?
Finally, even if the code issues were corrected, this doesn't seem to do what you asked for. From your requirements, I gather that you want the information the user entered to be rounded and copied somewhere else on the form, but this code calculates hours worked, instead. Are you wanting the user's entries to be copied somewhere else and rounded so you can calculate from the rounded numbers? Or are you wanting the hours calculated first, then rounded to the nearest quarter hour?