In most cases, you won't have any trouble getting your security deposit back. In a few cases, however, you may need to bring in some really scary people: lawyers.
Before it gets to that point, continue documenting everything and know your rights. Remember how we told you to get the age of things like paint and carpet? If the landlord is going to charge you for carpet replacement, in many places, he or she can only charge you for part of the amount depending on the age of the carpet. That is, you can't be charged for the full cost of brand-new carpet if the carpet was left over from the Nixon administration and needed to be replaced anyway. If your landlord is withholding all or part of your security deposit, they will have to not only document the damages, but also provide an itemized list of repairs and costs. You may have grounds to dispute these costs, especially if you were otherwise a good tenant, stayed on top of repairs and cleaning and documented everything (do you see a theme emerging here?)
If your landlord is still stalling, keep lines of communication open, but get everything in writing. This is the kind of situation e-mail was made for. Keep it civil, state your case, back it up with photos, your lease agreement and the rental laws in your area. If your landlord is clearly violating the law or your lease, you can take them to small claims court to get your security deposit back.
When you do get your deposit back, I suggest using it to start saving for buying a place of your own, so you never have to deal with crazy landlords again.