I rap for fun sometimes, freestyle, my friends say im good but whenever i write i dont do as well, i just lose the flow.
when you freestyle flowing is easy, what you gotta do is, write down what you can when you get the feelin of writin, dont worry about flow yet, make sure you make your lyrics clever or different, personally i put lots of wordplay in, but anyways. when you pick a beat or already have a beat just chop your sentances and make them bigger / smaller to what is needed.
A trick is, (im guessing you record your shit) basically, record a couple of lines. stop recording. record couple of lines again... repeat.
ive never done it, but all the commercial rappers do this ^^