Yes, your math seems correct for your traps.

Following guidelines Acid Arrow trap would cost 500gp * 2 (spell level) * 3 (caster level) = 3000 gp (and 40 * 2 * 3 = 240 XP).

Note that traps are actually rather cheap. For example if you had a trap of cure minor wounds it would cost you 500gp * 1/2 (spell level for item creation purpose) * 1 (caster level) = 250gp and 40 * 1/2 * 1 = 20 XP. And it would heal 1 HP per round. Without limits.