Trying to get a block to move up and down but it keeps only moving up

Your graph is always returning a positive value, so it will always go up. Try moving the points on the timeline to be half below and half above the 0 line