First of all you should use arrayjobx and not arrayjob (the latter is not really compatible with LaTeX).
Secondly, \let\a\dimexpr will make \a equivalent to \dimexpr and try printing \cws(0)+\cws(1)\relax; then \a will produce an error just like
\dimexpr
\end{document}
You should use \newcommand and not \let, but it won't do anyway, because \cws(0) is not good inside `\dimexpr, as it requires assignments that are not performed in that context.
Here's a different implementation using expl3 and its property lists.
\documentclass[a4paper,10pt]{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\DeclareArray}{m}
{
\prop_new:c { l_nagylzs_array_#1_prop }
\cs_new:cpn { #1 } ##1 { \prop_item:cn { l_nagylzs_array_#1_prop } { ##1 } }
}
\NewDocumentCommand{\setarray}{mmm}
{
\prop_put:cnn { l_nagylzs_array_#1_prop } { #2 } { #3 }
}
\ExplSyntaxOff
\begin{document}
\DeclareArray{cws}
\setarray{cws}{0}{3pt}
\setarray{cws}{1}{4pt}
\setarray{cws}{2}{1in}
\newcommand\foo{\dimexpr\cws{0}+\cws{1}+\cws{2}\relax}
A\hspace{\foo}B
A\hspace{\dimexpr\cws{0}+\cws{1}\relax}B
A\hspace{\dimexpr\cws{0}\relax}B
\end{document}

A package free version, that however is less flexible.
\documentclass[a4paper,10pt]{article}
\makeatletter
\newcommand\newarray[1]{%
\newcommand{#1}[1]{\@nameuse{nagylzs@\string#1@##1}}%
}
\newcommand{\set}[3]{\@namedef{nagylzs@\string#1@#2}{#3}}
\makeatother
\begin{document}
\newarray{\cws}
\set\cws{0}{3pt}
\set\cws{1}{4pt}
\set\cws{2}{1in}
\newcommand\foo{\dimexpr\cws{0}+\cws{1}+\cws{2}\relax}
A\hspace{\foo}B
A\hspace{\dimexpr\cws{0}+\cws{1}\relax}B
A\hspace{\dimexpr\cws{0}\relax}B
\end{document}
Explanation. There is no array data type in TeX, so one has to build it. This implementation uses \csname which provides a kind of associative memory.
Defining an array simply defines a command for using the values stored with \set. The command \cws{0} expands to
\@nameuse{nagylzs@\string\cws@0}
that's the same as
\csname nagylzs@\string\cws@0\endcsname
Note that \cws is “stringified”, so it can appear in \csname...\endcsname. The \set command does the association: \set\cws{0}{3pt} does
\@namedef{nagylzs@\string\cws@0}{4pt}
which is the same as
\expandafter\def\csname nagylzs@\string\cws@0\endcsname{4pt}
The association is thus in the name of a macro. The macro name is complicated in order to avoid collisions with other macros.