Any reason you're not using the 8 direction behavior? It should encompass everything you require. Set acceleration based on your stick axis value.
If you want to do it yourself, from what I understand from your description, you're mostly doing it correctly. You'll need velocity and acceleration variables per axis (x and y I assume). Your input determines your acceleration. Every tick, your acceleration will be added to your velocity. For caps, you'll be using the max() and min() expressions. Given no input (else condition), you will need to subtract a set amount from velocity (or add, if it is already negative) towards 0, which represents deceleration/friction.